GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
On Ubuntu (I haven't tested other varients of Linux) pressing the power button while XBMC is fullscreen sends a keypress. At the moment keyboard.xml has no mapping for this keypress, so this commit adds a mapping to XBMC.Shutdown.
NB in XBMCBuntu the power button already shuts down the system. It's possible this mapping could interfere with this, but I have no way of testing this.
See http://trac.xbmc.org/ticket/10004 for the original problem report.
Add key mapping for the power button
Hmm, I wonder if it would be better to use ActivateWindow(shutdownmenu), or maybe leave things as they are.
I don't feel strongly about this: I'm just responding to the Trac report. Views from the team would be welcome.
i've mapped it to shutdownmenu for the nyxboard a couple of days ago, but i don't mind changing it to xbmc.shutdown instead to match this default keymap.
@Lars, you've used "<key id='61952'"> and 61952 is 0xF200 hex, which is generated for every unrecognised keypress. Assuming we're still talking about Linux, I've just tried my (Mk 1) Nyxboard with Ubuntu 12.10 and it generates scan code 0x96 and keysym.sym = 0x9F. This isn't recognised by XBMC, which is why you get an unknown key. To make this work we need to add a mapping for a new key e.g. "<sleep>".
Was it you added this key to the SymMappingsEvdev array in WinEventsSDL.cpp? Do you want me to add the sleep key to the keys XBMC knows about?
right, that's wrong indeed :)
i've just checked openelec, and i'm getting another keysym value here:
Keyboard: scancode: 96, sym: 1008ff2f, unicode: 0000, modifier: 0
Note that SDL on Linux will be history soon and it's already history for OE 3. WinEventsX11.cpp uses codes from X11/XF86keysym.h and does the mapping to XBMC_Keys. I think we don't have a XBMCK_SLEEP, do we?
define XF86XK_Sleep 0x1008FF2F
@Lars: see https://github.com/jhsrennie/xbmc/commit/169be40560488d0e6ca9548dc694e7ca0005288e
@FernetMenta: as it stands SDL doesn't process many keys properly and we have to do a tacky fixup to convert the scan code to a keysym.sym value. The standard SDL headers don't (as far as I can see) define a constant for the sleep key so in the above commit I've just invented one. I'm not sure how this will play with OpenElec. Really, the sooner we can be rid of SDL the better, but for now we need something that works for Frodo.
@FernetMenta: where do I find WinEventsX11.cpp? Is it in a branch or different repository? I can't see any such file in my repo here.
@jhsrennie see #1175 SymMappingsX11 in WinEventsX11.cpp
I was not aware that you are discussing this for Frodo.
I assumed we'd want this in Frodo, or at least I assume Lars wants the Nyxboard fix in Frodo, but maybe it's too late and we should wait for 12.1.
i'll test it and shout, so it can be included in frodo. cause i want this in for the nyxboard indeed. minor change and the power button doesn't work properly without.
@Lars: I should probably remove the mapping from the sleep key from the Nyxboard file and put in system/keymaps/keyboard.xml as something like:
I'll close this pull request and create a new one that includes the handling of the Nyxboard sleep button
indeed, already thought about that. and the one below can be changed to F4 too
@Lars: this includes your change to the mapping for F4. can you test and let me know if this works for you.
yeah i noticed, thanks