Skip to content
This repository
Browse code

Merge pull request #2077 from jhsrennie/sleepkey

Add support for the power and sleep buttons
  • Loading branch information...
commit 7d4b8a81b86c88078ded69acebc7cf9b04870a47 2 parents 2fbabe5 + 1a7e31f
John Rennie authored January 16, 2013
2  system/keymaps/keyboard.xml
@@ -94,6 +94,8 @@
94 94
       <backslash>ToggleFullScreen</backslash>
95 95
       <home>FirstPage</home>
96 96
       <end>LastPage</end>
  97
+      <power>ActivateWindow(shutdownmenu)</power>
  98
+      <sleep>ActivateWindow(shutdownmenu)</sleep>
97 99
       <!-- PVR windows -->
98 100
       <e>XBMC.ActivateWindowAndFocus(MyPVR, 31,0, 10,0)</e>
99 101
       <h>XBMC.ActivateWindowAndFocus(MyPVR, 32,0, 11,0)</h>
3  system/keymaps/nyxboard/keyboard.xml
@@ -8,8 +8,7 @@
8 8
       <f4 mod="shift">ActivateWindow(music)</f4>    <!-- Green -->
9 9
       <f5 mod="shift">ActivateWindow(pictures)</f5> <!-- Yellow -->
10 10
       <f6 mod="shift">ActivateWindow(programs)</f6> <!-- Blue -->
11  
-      <key id='61952'>ActivateWindow(shutdownmenu)</key> <!-- Power button -->
12  
-      <key id='285'>ContextMenu</key>                    <!-- User button -->
  11
+      <f4>ContextMenu</f4>                          <!-- User button -->
13 12
     </keyboard>
14 13
   </global>
15 14
 </keymap>
1  xbmc/input/XBMC_keysym.h
@@ -214,6 +214,7 @@ typedef enum {
214 214
   XBMCK_POWER       = 0x140,    // Power Macintosh power key
215 215
   XBMCK_EURO        = 0x141,    // Some european keyboards
216 216
   XBMCK_UNDO        = 0x142,    // Atari keyboard has Undo
  217
+  XBMCK_SLEEP       = 0x143,    // Sleep button on Nyxboard remote (and others?)
217 218
 
218 219
   // Add any other keys here
219 220
 
1  xbmc/input/XBMC_keytable.cpp
@@ -222,6 +222,7 @@ static const XBMCKEYTABLE XBMCKeyTable[] =
222 222
 , { XBMCK_SCROLLOCK,              0,    0, XBMCVK_SCROLLLOCK,    "scrolllock" }
223 223
 , { XBMCK_PRINT,                  0,    0, XBMCVK_PRINTSCREEN,   "printscreen" }
224 224
 , { XBMCK_POWER,                  0,    0, XBMCVK_POWER,         "power" }
  225
+, { XBMCK_SLEEP,                  0,    0, XBMCVK_SLEEP,         "sleep" }
225 226
 };
226 227
 
227 228
 static int XBMCKeyTableSize = sizeof(XBMCKeyTable)/sizeof(XBMCKEYTABLE);
1  xbmc/input/XBMC_vkeys.h
@@ -205,6 +205,7 @@ typedef enum {
205 205
   XBMCVK_SCROLLLOCK     = 0xDC,
206 206
   XBMCVK_PAUSE          = 0XDD,
207 207
   XBMCVK_POWER          = 0XDE,
  208
+  XBMCVK_SLEEP          = 0XDF,
208 209
 
209 210
   XBMCVK_LAST           = 0xFF
210 211
 } XBMCVKey;
2  xbmc/windowing/WinEventsSDL.cpp
@@ -69,7 +69,7 @@ static uint16_t SymMappingsEvdev[][2] =
69 69
 , { 138, 0x69 /* 'i' */}             // Info
70 70
 , { 147, 0x6d /* 'm' */}             // Menu
71 71
 , { 148, XBMCK_LAUNCH_APP2 }         // Launch app 2
72  
-, { 150, 0x9f }                      // Sleep
  72
+, { 150, XBMCK_SLEEP }               // Sleep
73 73
 , { 152, XBMCK_LAUNCH_APP1 }         // Launch app 1
74 74
 , { 163, XBMCK_LAUNCH_MAIL }         // Launch Mail
75 75
 , { 164, XBMCK_BROWSER_FAVORITES }   // Browser favorites

0 notes on commit 7d4b8a8

Please sign in to comment.
Something went wrong with that request. Please try again.