[haiku-commits] Re: r43210 - haiku/trunk/src/preferences/keymap

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 7 Nov 2011 18:11:17 -0500

On Mon, Nov 7, 2011 at 10:54 AM, Adrien Destugues <
pulkomandy@xxxxxxxxxxxxxxxxx> wrote:

> Seeing that with the french keyboard, and any other having an altGr
> key, they are out of sync in the default setup, I think this isn't
> going to help much.
>
> The french keyboard currently has this mapping :
> Left control = CRTL
> Left Windows Key = OPT
> Alt = CMD
> ALT GR = OPT
> Right Windows Key = CMD
> Menu key = MENU
> Right control = CTRL


> As you can see, we end up with the two window key doing different
> things.
> This is because we (mis)use the OPT as Alt GR, used for reaching more
> characters and most of the dead keys on french, and likely most
> european, keyboards. This means we're out of keycodes for the "window"
> keys. Having both ALT and ALT GR do either OPT or CMD always get
> confusing. And having the left window key do something else than OPT is
> also confusing.
>
> I guess[sic] this goes unnoticed because nobody uses right win-key.
>
> The result is, I think, that your change will likely mess[sic] up the
> default
> setup for us Europeans[sic].
>

First of all let me say that I had to transliterate some Portuguese at work
today. I think the gods must be punishing me here.


This is what I was afraid of when I hard-coded keycodes in the dialog. Here
is what I need to do to make this work properly. Right now Haiku keeps
track of just one keymap, the keymap that you set in the Keymaps Preference
app (or at install time). If you make a change to the keymap, say by
changing your modifier keys the keymap is replaced. So I have no way to
reason about what your keymap looked like _before_ the change. To fix this
I need 2 keymaps, your system keymap, the one that is set at install time
(or changed by picking one of the keymaps in the system keymap list) and
your user keymap so that I can compare your current user keymap to the
current system keymap.

A way that this could be implemented is to set an attribute on the user
keymap that informs what system keymap the user keymap derived from.

So lets say you pick French as your system keymap, and then go into keymap
and alter a modifier key. The resulting user keymap file would get a
"DERIVED_FROM:French.keymap" attribute written to it. Then when you open up
the modifiers key dialog box and switch back to the default I can read that
attribute and know to pull the keycode from the French system keymap.

Does that make sense?


> As for the drag and drop, yes, it is confusing and sometimes not very
> practical. +1 to improving it. I think we should swap keys with the
> left mouse button, copy with modifier (pick one) + left button, and
> keep the right button for a popup menu wheer one could copy, paste, or
> unassign a key.


I like your ideas here. How about unmodified left mouse button swaps,
B_COMMAND_KEY (Alt) + drag copies, B_CONTROL_KEY + drag moves. Perhaps you
could even right click on the key to pop an option to disable the key.

John Scipione

Other related posts: