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

  • From: Siarzhuk Zharski <zharik@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 23 Oct 2013 09:57:27 +0200

Hallo John,

John Scipione писал 23.10.2013 03:10:
I wanted to bounce an idea off of you guys about a solution I've
thought up to bug #2499

http://dev.haiku-os.org/ticket/2499

[...]

Here is my idea.

We detect if you have a non-latin keymap, and if so, map these
shortcuts to letters that appear in the same positions on the default
US-International keymap rather than mapping them to the letters in the
current keymap.

KeymapSwitcher does such remapping (filtering and substituting) for years and I have no complains about this workaround. So this idea is looking good for me too. ;)

Let's look at the example of the Russian keymap:

The close window shortcut would be translated to CMD+ц (Tse). There is
likely no conflict here since it is unlikely that your app is going to
define CMD+ц, the same goes for the other built-in shortcuts.

There is an additional problem of the mapping changing when you switch
keymaps as well, that would need to be handled, actually, it's already
a problem.

Even if you solve the problem on keymap's level - those Russians™ will continue using KeymapSwitcher. Just because proposition to switch keymaps with the Keymap Preflet makes them ROFL-ing. ;-) In my opinion the problem should be solved as part of the native keymap switching implementation.

Let me explain once more as it is implemented in the KeymapSwitcher. The KS maintains the list of user-defined keymaps with the possibility to define some keymap as the "base" one to remap shortcuts characters into it. So if the keymap_switcher filter detects that modifier keys are pressed at the moment of the character filtering the character will be substituted with one from the "base" keymap and the system will receive Cmd-Q instead of Cmd-Й for example. The "base" keymap remapping can be naturally switched off or configured for any keymap in the list.

So my draft proposal is the following: app_server maintains the user-configurable list of keymap tables instead of the single keymap table as it does currently. Every BWindow or even BView instance in the system should "know" the keymap used to remap the characters that typed in. The shortcuts remapping and configuration is implemented as described in previous paragraph of this message. The [meta]shortcuts used to change the current keymap can be driven by already existing input server filter from Shortcuts Preflet.

By the way, there are no latin characters in Belarusian - the only latin looking character "і" is <U+0456> but not latin "i" <U+0069> ;-)

--
Kind Regards,
   S.Zharski

Other related posts: