tt9 icon indicating copy to clipboard operation
tt9 copied to clipboard

Add a command palette

Open sspanak opened this issue 2 years ago • 2 comments
trafficstars

For easier access to functions on phones with few hardware buttons, it would be easier to invoke the respective functions with star+number combos, instead of with hotkeys. For example, #83 and #170 would require multiple key control keys.

Also, the hotkey processing is getting more and more complex, which is not the way to go.

To resolve this, add a command palette:

  • Split TraditionalT9 class in three logical pieces.
    • TypingHandler extends KeyPadHandler. It contains 0-9, Ok and backspace processing code.
    • HotkeyHandler extends TypingHandler. It contains the hotkey code TraditionalT9 is on top and contains tools like getting the context and whatnot
  • Add a "show commands" hotkey. It will display a numbered list of commands. Default key is: "*".
  • Pressing a number when the command palette is on invokes the respective command.
  • Command list: 1. Add word; 2. Show settings
  • Remove the "Add Word" and "Show Settings" hotkeys.
  • Make sure the command palette fits well, when the on-screen keyboard is on.
  • Make the list touchable, so it can be used on a device without a hardware keypad.
  • ~~Remove Add word and settings handling from KeyPadHandler.~~ Done in another issue.
  • ~~Make a migration for resetting the hotkeys~~ There is no need to migrate anything. The old hotkeys will simply not exist.

sspanak avatar May 25 '23 07:05 sspanak

I suggest leaving in the Add Word and Show Settings hotkeys. It just increases the customizability available to people. Some people prefer weird things!

stianhoiland avatar Aug 10 '23 06:08 stianhoiland

Well, I suppose there is no harm in leaving the hotkeys.

sspanak avatar Aug 14 '23 13:08 sspanak

After all, I've decided to reduce the number of hotkeys to minimum to make the code simpler and easier to maintain. I believe the new command palette will be convenient enough to compensate for that.

sspanak avatar May 30 '24 07:05 sspanak