isFromSoftKeyboard

IMEs synthesise their key events against the virtual device and flag them; AOSP's own soft keyboard sets both, so either alone identifies one.

True when this event came from an on-screen keyboard rather than a physical one.

An on-screen keyboard has no Shift to reach a newline with, so a shortcut that consumes Enter must exempt it or that field can never hold more than one line.

Desktop has no on-screen keyboard; every key event is physical.