We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4167 - MENU key(s) not supported under X11
Summary: MENU key(s) not supported under X11
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.8
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-12 17:41 UTC by Michael Roe
Modified: 2018-05-12 19:54 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Roe 2018-05-12 17:41:42 UTC
The USB HID standard defines at least two different Menu keys, Keyboard.Menu and Consumer.Menu. The standard Linux X11 keymap considers these to be two different keys. SDL doesn't support either of them.

Keyboard.Menu maps to Linux event KEY_PROPS and X11 keysym SunProps (this key used to be called Props on Sun keyboards).

Consumer.Menu maps to Linux event KEY_MENU and X11 keysym XF86MenuKB.

Consumer.Menu is what you get when you press "Menu" on the remote control of your Linux media centre. Keyboard.Menu is what you get is you happen to have an old Sun keyboard.

I'd like Consumer.Menu to work, and don't care so much about Keyboard.Menu.

My suggestions for a possible fix:

Either
(a) Map KEY_MENU and XF86MenuKB to SDL_SCANCODE_MENU, and hope nobody cares about Keyboard.Menu
(b) Treat the two menu keys as the same. Map KEY_MENU, KEY_PROPS and XF86MenuKB to SDL_SCANCODE_Menu. (Don't map SunProps to anything. Treat it as a keyboard kayout that has a weird and unsupported keysym assigned to that scancode).
(c) Invent a new SDL scancode, and map the KEY_MENU and KEY_PROPS to different SDL scancodes.
Comment 1 Michael Roe 2018-05-12 19:54:58 UTC
An update on this bug: The Linux USB keyboard driver maps both Keyboard.Menu and Consumer.AC Properties to KEY_PROPS. (Presumably because on Sun keyboards, the key was labelled Props but generated Keyboard.Menu). So SDL probably shouldn't map KEY_PROPS to SDL_SCANCODE_MENU.

Mapping KEY_MENU to SDL_SCANCODE_MENU still looks a good solution to getting the Menu key on media center PCs to work.