#7965: Keymap Modifiers Menu with Mac Modifiers Option ----------------------------------+---------------------------- Reporter: jscipione | Owner: axeld Type: enhancement | Status: new Priority: normal | Milestone: R1 Component: Preferences/Keymap | Version: R1/Development Resolution: | Keywords: Blocked By: | Blocking: Has a Patch: 1 | Platform: All ----------------------------------+---------------------------- Comment (by jscipione): Replying to [comment:8 axeld]: > A Mac keyboard isn't just about switching the modifiers. You would need to have a "* (Mac)" equivalent of your keymap, and that one might be automatically selected (which takes care of the any mapping changes). Bullshit, the "* (Mac)" keymaps are a hack and should be removed. Creating a special "* Mac" variation for each keymap is redundant. Instead, we should detect whether or not you are using a Mac keyboard, and if so, make the appropriate adjustments. We can detect whether or not you are using a Mac keyboard by probing the USB devices and look for a device with vendor ID 0x05ac (Apple, Inc.) and device ID 0x0201-0x02ff (keyboards). When a Mac keyboard is detected the unmodified B_COMMMAND and B_OPTION codes are reversed (B_LEFT_OPTION = 0x5d, B_LEFT_COMMAND = 0x66, B_RIGHT_OPTION = 0x5f, B_RIGHT_COMMAND = 0x67), the numeric keypad equals key code (0x6a) is mapped, and the upper F keys (F13-F19) are mapped. All other keys use the same keycodes as a PC keyboard. We may also want to apply the same hack that Virtual Box uses to map F14 to Print Screen. The Menu key, not present on a Mac keyboard would need to be simulated. However, this is already needed for 101-key keyboards anyway and I am pretty sure that BeOS 5 provided a solution for this that we should simply copy. > The these keymaps, the button could be hidden, as it's pretty much useless (although I could imagine a bug report "hey, this button is sometimes not visible"). Using separate keymaps, the user feedback would be quite sufficient. If the above solution were to be implemented then the Switch Modifiers button would indeed become superfluous and could be hidden. The button is a hack to placate Windows users after all. The patches on this ticket would also be rendered useless. -- Ticket URL: <http://dev.haiku-os.org/ticket/7965#comment:9> Haiku <http://dev.haiku-os.org> Haiku - the operating system.