Skip to content

Commit

Permalink
Merge pull request #2077 from jhsrennie/sleepkey
Browse files Browse the repository at this point in the history
Add support for the power and sleep buttons
  • Loading branch information
John Rennie committed Jan 17, 2013
2 parents 2fbabe5 + 1a7e31f commit 7d4b8a8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions system/keymaps/keyboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
<backslash>ToggleFullScreen</backslash>
<home>FirstPage</home>
<end>LastPage</end>
<power>ActivateWindow(shutdownmenu)</power>
<sleep>ActivateWindow(shutdownmenu)</sleep>
<!-- PVR windows -->
<e>XBMC.ActivateWindowAndFocus(MyPVR, 31,0, 10,0)</e>
<h>XBMC.ActivateWindowAndFocus(MyPVR, 32,0, 11,0)</h>
Expand Down
3 changes: 1 addition & 2 deletions system/keymaps/nyxboard/keyboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<f4 mod="shift">ActivateWindow(music)</f4> <!-- Green -->
<f5 mod="shift">ActivateWindow(pictures)</f5> <!-- Yellow -->
<f6 mod="shift">ActivateWindow(programs)</f6> <!-- Blue -->
<key id='61952'>ActivateWindow(shutdownmenu)</key> <!-- Power button -->
<key id='285'>ContextMenu</key> <!-- User button -->
<f4>ContextMenu</f4> <!-- User button -->
</keyboard>
</global>
</keymap>
1 change: 1 addition & 0 deletions xbmc/input/XBMC_keysym.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ typedef enum {
XBMCK_POWER = 0x140, // Power Macintosh power key
XBMCK_EURO = 0x141, // Some european keyboards
XBMCK_UNDO = 0x142, // Atari keyboard has Undo
XBMCK_SLEEP = 0x143, // Sleep button on Nyxboard remote (and others?)

// Add any other keys here

Expand Down
1 change: 1 addition & 0 deletions xbmc/input/XBMC_keytable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ static const XBMCKEYTABLE XBMCKeyTable[] =
, { XBMCK_SCROLLOCK, 0, 0, XBMCVK_SCROLLLOCK, "scrolllock" }
, { XBMCK_PRINT, 0, 0, XBMCVK_PRINTSCREEN, "printscreen" }
, { XBMCK_POWER, 0, 0, XBMCVK_POWER, "power" }
, { XBMCK_SLEEP, 0, 0, XBMCVK_SLEEP, "sleep" }
};

static int XBMCKeyTableSize = sizeof(XBMCKeyTable)/sizeof(XBMCKEYTABLE);
Expand Down
1 change: 1 addition & 0 deletions xbmc/input/XBMC_vkeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ typedef enum {
XBMCVK_SCROLLLOCK = 0xDC,
XBMCVK_PAUSE = 0XDD,
XBMCVK_POWER = 0XDE,
XBMCVK_SLEEP = 0XDF,

XBMCVK_LAST = 0xFF
} XBMCVKey;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/windowing/WinEventsSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static uint16_t SymMappingsEvdev[][2] =
, { 138, 0x69 /* 'i' */} // Info
, { 147, 0x6d /* 'm' */} // Menu
, { 148, XBMCK_LAUNCH_APP2 } // Launch app 2
, { 150, 0x9f } // Sleep
, { 150, XBMCK_SLEEP } // Sleep
, { 152, XBMCK_LAUNCH_APP1 } // Launch app 1
, { 163, XBMCK_LAUNCH_MAIL } // Launch Mail
, { 164, XBMCK_BROWSER_FAVORITES } // Browser favorites
Expand Down

0 comments on commit 7d4b8a8

Please sign in to comment.