[haiku-development] Re: Bug #2499 Shortcuts based on default keymap

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 24 Oct 2013 17:40:03 +0200

Am 23/10/2013 07:58, schrieb scottmc:
    I think this problem needs more thinking and work than just a few
    tweaks to
    the code. How do other systems/UI toolkits handle it, for example ?
    (someone non-latin keymap user around ? can you tell us what happens in
    Linux,Windows,OS X, ... ?) We may need to introduce a new shortcuts API
    alongside the old one that allows this to work. Without making it too
    painful to handle for app developers.
This might make for an excellent GCI research task...

Definitely worth a try.

I think for solving this for real in the future we need to introduce a completely new API to register and handle shortcuts. The system could then offer a UI component to configure those shortcuts (embedded into an application, but also as a global preferences panel).

Anyway, for a shortcut there needs to be a notion whether the exact location on the keyboard is important (could be implemented by specifying either the key code or the character on the standard English keymap), or if the letter itself is important. For keymap switchers, there could be an option to always use the same keys (based on a favorite keymap), no matter what keymap is currently chosen.

The former would be keymap independent, the latter could be allocated as needed. The important point is that the requested character should only be considered a constraint not a must. This way, the application developer does not need to care about the shortcuts (within the above mentioned restrictions), but the Interface Kit would make sure that no shortcut is overwritten or inaccessible. The shortcuts are shown to the user via the Interface Kit anyway, although a method to retrieve the current shortcut mapping could be helpful, too.

The shortcut mechanism could also go as far as ignoring modifiers unless there is a ambiguity to resolve, ie. on an English keymap, + and = would always trigger the same shortcut unless the developer specifically asked for those two with different modifiers.

Bye,
   Axel.


Other related posts: