Opened 14 years ago

Closed 9 years ago

#6364 closed enhancement (duplicate)

Fix keymaps (physical keys with same labels should have same functions)

Reported by: rq Owned by: axeld
Priority: normal Milestone: R1
Component: Preferences/Keymap Version: R1/alpha2
Keywords: Cc:
Blocked By: #6442 Blocking:
Platform: All

Description

Some may disagree, but I strongly suggest that the functions of same keys on different sides of the keyboard should be the same. By that I mean that I find it weird that:

  • Right Ctrl key has the same function as left Alt key
  • Left Ctrl has a different function.
  • Right Alt key has the same function as Left Windows (Cmd?) key
  • Right Windows key seems simply unassigned.

While I know that we strive for compatibility with BeOS, I also wish we didn't sacrifice sane choices just in favor of it. Don't forget that BeOS was designed for its own distinct computer which probably had its own distinct keyboard. Plus, it was influenced by Macs, while I think we target PC's mostly.

My suggestion is simple: the physical key labels should match programmatical ones.

  • both Ctrl keys should have the same function.
  • both Win/Cmd keys should have the same function
  • Alt/Opt keys could either have the same, or two distinct functions, but only because right Alt is designated AltGr (and is usually the only key that toggles third level) on European keyboards.

This should be reflected in Keymap preflet, but also deeper in the OS itself.

See also #6362

http://dev.haiku-os.org/attachment/ticket/6362/haiku%20keyboard.PNG

Change History (14)

comment:1 by rq, 14 years ago

Oops, here's the actual image: Screenshot of the keys in question

comment:2 by tqh, 14 years ago

I would prefer this as well.

in reply to:  description comment:3 by bonefish, 14 years ago

When I select the "American" keymap and the respective layout for my keyboard I get the exact mapping I would expect: left/right Control -> Control, left/right Alt -> Command, Windows -> Option, Menu -> Menu. Changing the shortcut modifier switches the Control and Command mapping, just as expected. Setting the "German" keymap has a similar result: AltGr is mapped to Option (with the expected behavior), the rest of the modifiers remain unchanged. Depending on whether Control or Alt are set as the shortcut key there's only one key with Control or one key with Command functionality, also as expected.

So, everything works fine here. If something goes wrong in your case, I suspect it must be the specific keymap you're using. You failed to mention what keymap that would be.

comment:4 by rq, 14 years ago

Wow, you're right. American keymap is correct.

However, if you quickly cycle through all keymaps from A to Z, you'll see clearly, that the absolute majority of them either has Right OPT swapped with CMD, or doesn't even have CMD. I think this bug can be re-qualified to "Fix all keyboard layouts to be consistent".

In my screenshot, Lithuanian is pictured, but really – most of the keymaps appear to be broken, American is basically an exception.

BTW shouldn't it be called English (US) instead?

comment:5 by rq, 14 years ago

Summary: Physical keys with same labels should have same functionsFix keymaps (physical keys with same labels should have same functions)

Apparently, the only keymaps that are not affected by this bug are:

  • American
  • Colemac
  • Dvorak

in reply to:  4 ; comment:6 by anevilyak, 14 years ago

Replying to rq:

Wow, you're right. American keymap is correct.

However, if you quickly cycle through all keymaps from A to Z, you'll see clearly, that the absolute majority of them either has Right OPT swapped with CMD, or doesn't even have CMD. I think this bug can be re-qualified to "Fix all keyboard layouts to be consistent".

That's not a bug. On almost all other layouts, right alt = Alt Gr, which is *not* the same as regular Alt.

in reply to:  6 ; comment:7 by rq, 14 years ago

Replying to anevilyak:

On almost all other layouts, right alt = Alt Gr, which is *not* the same as regular Alt.

Sure, but:

  • AltGr is also not the same as left Winkey
  • Right Winkey is not the same as Left Ctrl
  • Right Ctrl is not the same as Left Alt

Right now everything seems just so messed up... Perhaps AltGr should have its own VK name?

Furthermore, regardless of all of the above, there are quite a few keyboard layouts where Right Winkey is simply unassigned. At least that should be fixed.

in reply to:  7 ; comment:8 by bonefish, 14 years ago

Replying to rq:

Replying to anevilyak:

On almost all other layouts, right alt = Alt Gr, which is *not* the same as regular Alt.

Sure, but:

  • AltGr is also not the same as left Winkey

ATM the API doesn't specify an AltGr function. I'm not sure we can change that without breaking compatibility.

  • Right Winkey is not the same as Left Ctrl

Lacking a keyboard with a right Windows key I can't test that. Obviously the right Windows key should also be mapped to Option.

  • Right Ctrl is not the same as Left Alt

At least with the "American" and "German" keymaps I tested here, the right Control key is mapped to Control (with Alt = Command). If that isn't the case for other keymaps, then they need to be fixed.

Furthermore, regardless of all of the above, there are quite a few keyboard layouts where Right Winkey is simply unassigned. At least that should be fixed.

Sure.

in reply to:  8 ; comment:9 by rq, 14 years ago

Replying to bonefish:

Replying to rq:

Replying to anevilyak:

On almost all other layouts, right alt = Alt Gr, which is *not* the same as regular Alt.

Sure, but:

  • AltGr is also not the same as left Winkey

ATM the API doesn't specify an AltGr function. I'm not sure we can change that without breaking compatibility.

Could anyone investigate that?

  • Right Winkey is not the same as Left Ctrl

Lacking a keyboard with a right Windows key I can't test that. Obviously the right Windows key should also be mapped to Option.

  • Right Ctrl is not the same as Left Alt

At least with the "American" and "German" keymaps I tested here, the right Control key is mapped to Control (with Alt = Command). If that isn't the case for other keymaps, then they need to be fixed.

You can compare the picture above to the generic layout I have on my 105-key keyboard:

Ctrl Win Alt SPACE AltGr Win Menu Ctrl

in reply to:  9 comment:10 by rq, 14 years ago

Replying to rq:

Replying to bonefish:

ATM the API doesn't specify an AltGr function. I'm not sure we can change that without breaking compatibility.

Could anyone investigate that?

Per pulkomandy's suggestion, I filed ticket #6442 about this particular problem.

comment:11 by pulkomandy, 14 years ago

Blocked By: 6442 added

comment:12 by pulkomandy, 14 years ago

Blocked By: 6442 removed

(In #6442) After a quick look at the API, we currently have 16 allocated bits in the modifier enum, and the API seems to use an int32 everywhere, so we could add a "B_LEVEL3_KEY" without breaking anything.

comment:13 by rq, 12 years ago

I filed #8353 to fix Lithuanian keymap and attached a patch there.

comment:14 by pulkomandy, 9 years ago

Blocked By: 6442 added
Resolution: duplicate
Status: newclosed

Lithuanian was the only keymap with misplaced left ctrl and this was fixed in #8553. The remaining problems are all because of lacking a separate altgr keycode which is already tracked in #6442.

Note: See TracTickets for help on using tickets.