Why do text input methods generally omit an undo function?



  • I'm reading through my keyboard's resource documentation (I use https://play.google.com/store/apps/details?id=com.exideas.mekb normally), and I see that they state:

    MessagEase Screenshot

    Please note the Android does not provide any Undo.

    However, I know this isn't actually true — at least, not in any apparent manner — because when using a physical keyboard Ctrl+Z invokes undo just fine, and doesn't require any additional/external applications, i.e., works natively via generic PNP (I've used telnet, BT, and RF varieties, all of which work). And yet, mysteriously enough, the function seems to be omitted intentionally (disclaimer: I have no evidence to support this conjecture).

    In fact, MessagEase has extended input functionalities that include form field controls and ASCII character controls, and yet inputting Ctrl+Z results in a notdef glyph output in the exact same form field.

    Why is this the case?

    EDIT: Please note that I am referring to connecting a physical keyboard to an Android device, I am not comparing PC vs Android UX.



  • This question can get better answers from developers than the end user community.

    Android framework does have a class named https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-11.0.0_r1/core/java/android/content/UndoManager.java "for managing and interacting with the global undo state for a document or application. This class supports both undo and redo...". And Android's EditText view (which extends TextView, and is commonly used in apps to get text input from the user) does support Undo and Redo operations since Android 6 at least. In fact a ROM developer can show these options in long press context menu for every app, as we see Copy, Paste and Select All, which are displayed https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-11.0.0_r1/core/java/android/widget/TextView.java#12280 . But Undo / Redo always work if the virtual or physical keyboard can send CTRL-Z and CTRL-SHIFT-Z key events.

    I https://github.com/AnySoftKeyboard/AnySoftKeyboard/pull/2407/commits CTRL- events support in AnySoftKeyboard for non-terminal apps. So anyone can. Why they don't is purely a matter of choice. There's no technical limitation.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2