8 * Copyright (C) 2005-2013 Team XBMC
11 * This Program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option)
16 * This Program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with XBMC; see the file COPYING. If not, see
23 * <http://www.gnu.org/licenses/>.
35 * EventServer "gamepad" keys based on original Xbox controller
37 // Analogue - don't change order
38 #define KEY_BUTTON_A 256
39 #define KEY_BUTTON_B 257
40 #define KEY_BUTTON_X 258
41 #define KEY_BUTTON_Y 259
42 #define KEY_BUTTON_BLACK 260
43 #define KEY_BUTTON_WHITE 261
44 #define KEY_BUTTON_LEFT_TRIGGER 262
45 #define KEY_BUTTON_RIGHT_TRIGGER 263
47 #define KEY_BUTTON_LEFT_THUMB_STICK 264
48 #define KEY_BUTTON_RIGHT_THUMB_STICK 265
50 #define KEY_BUTTON_RIGHT_THUMB_STICK_UP 266 // right thumb stick directions
51 #define KEY_BUTTON_RIGHT_THUMB_STICK_DOWN 267 // for defining different actions per direction
52 #define KEY_BUTTON_RIGHT_THUMB_STICK_LEFT 268
53 #define KEY_BUTTON_RIGHT_THUMB_STICK_RIGHT 269
55 // Digital - don't change order
56 #define KEY_BUTTON_DPAD_UP 270
57 #define KEY_BUTTON_DPAD_DOWN 271
58 #define KEY_BUTTON_DPAD_LEFT 272
59 #define KEY_BUTTON_DPAD_RIGHT 273
61 #define KEY_BUTTON_START 274
62 #define KEY_BUTTON_BACK 275
64 #define KEY_BUTTON_LEFT_THUMB_BUTTON 276
65 #define KEY_BUTTON_RIGHT_THUMB_BUTTON 277
67 #define KEY_BUTTON_LEFT_ANALOG_TRIGGER 278
68 #define KEY_BUTTON_RIGHT_ANALOG_TRIGGER 279
70 #define KEY_BUTTON_LEFT_THUMB_STICK_UP 280 // left thumb stick directions
71 #define KEY_BUTTON_LEFT_THUMB_STICK_DOWN 281 // for defining different actions per direction
72 #define KEY_BUTTON_LEFT_THUMB_STICK_LEFT 282
73 #define KEY_BUTTON_LEFT_THUMB_STICK_RIGHT 283
76 * joystick.xml keys based on Xbox 360 controller
78 #define KEY_JOYSTICK_BUTTON_A 284
79 #define KEY_JOYSTICK_BUTTON_B 285
80 #define KEY_JOYSTICK_BUTTON_X 286
81 #define KEY_JOYSTICK_BUTTON_Y 287
82 #define KEY_JOYSTICK_BUTTON_LEFT_SHOULDER 288
83 #define KEY_JOYSTICK_BUTTON_RIGHT_SHOULDER 289
84 #define KEY_JOYSTICK_BUTTON_LEFT_TRIGGER 290
85 #define KEY_JOYSTICK_BUTTON_RIGHT_TRIGGER 291
86 #define KEY_JOYSTICK_BUTTON_LEFT_STICK_BUTTON 292
87 #define KEY_JOYSTICK_BUTTON_RIGHT_STICK_BUTTON 293
88 #define KEY_JOYSTICK_BUTTON_RIGHT_THUMB_STICK_UP 294
89 #define KEY_JOYSTICK_BUTTON_RIGHT_THUMB_STICK_DOWN 295
90 #define KEY_JOYSTICK_BUTTON_RIGHT_THUMB_STICK_LEFT 296
91 #define KEY_JOYSTICK_BUTTON_RIGHT_THUMB_STICK_RIGHT 297
92 #define KEY_JOYSTICK_BUTTON_DPAD_UP 298
93 #define KEY_JOYSTICK_BUTTON_DPAD_DOWN 299
94 #define KEY_JOYSTICK_BUTTON_DPAD_LEFT 300
95 #define KEY_JOYSTICK_BUTTON_DPAD_RIGHT 301
96 #define KEY_JOYSTICK_BUTTON_START 302
97 #define KEY_JOYSTICK_BUTTON_BACK 303
98 #define KEY_JOYSTICK_BUTTON_LEFT_THUMB_STICK_UP 304
99 #define KEY_JOYSTICK_BUTTON_LEFT_THUMB_STICK_DOWN 305
100 #define KEY_JOYSTICK_BUTTON_LEFT_THUMB_STICK_LEFT 306
101 #define KEY_JOYSTICK_BUTTON_LEFT_THUMB_STICK_RIGHT 307
102 #define KEY_JOYSTICK_BUTTON_GUIDE 308
104 // 0xF000 -> 0xF200 is reserved for the keyboard; a keyboard press is either
105 #define KEY_VKEY 0xF000 // a virtual key/functional key e.g. cursor left
106 #define KEY_ASCII 0xF100 // a printable character in the range of TRUE ASCII (from 0 to 127) // FIXME make it clean and pure unicode! remove the need for KEY_ASCII
107 #define KEY_UNICODE 0xF200 // another printable character whose range is not included in this KEY code
109 // 0xE000 -> 0xEFFF is reserved for mouse actions
110 #define KEY_VMOUSE 0xEFFF
112 #define KEY_MOUSE_START 0xE000
113 #define KEY_MOUSE_CLICK 0xE000
114 #define KEY_MOUSE_RIGHTCLICK 0xE001
115 #define KEY_MOUSE_MIDDLECLICK 0xE002
116 #define KEY_MOUSE_DOUBLE_CLICK 0xE010
117 #define KEY_MOUSE_LONG_CLICK 0xE020
118 #define KEY_MOUSE_WHEEL_UP 0xE101
119 #define KEY_MOUSE_WHEEL_DOWN 0xE102
120 #define KEY_MOUSE_MOVE 0xE103
121 #define KEY_MOUSE_DRAG 0xE104
122 #define KEY_MOUSE_DRAG_START 0xE105
123 #define KEY_MOUSE_DRAG_END 0xE106
124 #define KEY_MOUSE_RDRAG 0xE107
125 #define KEY_MOUSE_RDRAG_START 0xE108
126 #define KEY_MOUSE_RDRAG_END 0xE109
127 #define KEY_MOUSE_NOOP 0xEFFF
128 #define KEY_MOUSE_END 0xEFFF
130 // 0xD000 -> 0xD0FF is reserved for WM_APPCOMMAND messages
131 #define KEY_APPCOMMAND 0xD000
133 // 0xF000 -> 0xF0FF is reserved for mouse actions
134 #define KEY_TOUCH 0xF000
136 #define KEY_INVALID 0xFFFF
138 // actions that we have defined...
140 * \defgroup kodi_key_action_ids Action Id's
141 * \ingroup python_xbmcgui_window_cb
142 * \ingroup python_xbmcgui_action
144 * @brief Actions that we have defined.
146 #define ACTION_NONE 0
147 #define ACTION_MOVE_LEFT 1
148 #define ACTION_MOVE_RIGHT 2
149 #define ACTION_MOVE_UP 3
150 #define ACTION_MOVE_DOWN 4
151 #define ACTION_PAGE_UP 5
152 #define ACTION_PAGE_DOWN 6
153 #define ACTION_SELECT_ITEM 7
154 #define ACTION_HIGHLIGHT_ITEM 8
155 #define ACTION_PARENT_DIR 9
156 #define ACTION_PREVIOUS_MENU 10
157 #define ACTION_SHOW_INFO 11
159 #define ACTION_PAUSE 12
160 #define ACTION_STOP 13
161 #define ACTION_NEXT_ITEM 14
162 #define ACTION_PREV_ITEM 15
163 #define ACTION_FORWARD 16 //!< Can be used to specify specific action in a window, Playback control is handled in ACTION_PLAYER_*
164 #define ACTION_REWIND 17 //!< Can be used to specify specific action in a window, Playback control is handled in ACTION_PLAYER_*
166 #define ACTION_SHOW_GUI 18 //!< toggle between GUI and movie or GUI and visualisation.
167 #define ACTION_ASPECT_RATIO 19 //!< toggle quick-access zoom modes. Can b used in videoFullScreen.zml window id=2005
168 #define ACTION_STEP_FORWARD 20 //!< seek +1% in the movie. Can b used in videoFullScreen.xml window id=2005
169 #define ACTION_STEP_BACK 21 //!< seek -1% in the movie. Can b used in videoFullScreen.xml window id=2005
170 #define ACTION_BIG_STEP_FORWARD 22 //!< seek +10% in the movie. Can b used in videoFullScreen.xml window id=2005
171 #define ACTION_BIG_STEP_BACK 23 //!< seek -10% in the movie. Can b used in videoFullScreen.xml window id=2005
172 #define ACTION_SHOW_OSD 24 //!< show/hide OSD. Can b used in videoFullScreen.xml window id=2005
173 #define ACTION_SHOW_SUBTITLES 25 //!< turn subtitles on/off. Can b used in videoFullScreen.xml window id=2005
174 #define ACTION_NEXT_SUBTITLE 26 //!< switch to next subtitle of movie. Can b used in videoFullScreen.xml window id=2005
175 #define ACTION_PLAYER_DEBUG 27 //!< show debug info for VideoPlayer
176 #define ACTION_NEXT_PICTURE 28 //!< show next picture of slideshow. Can b used in slideshow.xml window id=2007
177 #define ACTION_PREV_PICTURE 29 //!< show previous picture of slideshow. Can b used in slideshow.xml window id=2007
178 #define ACTION_ZOOM_OUT 30 //!< zoom in picture during slideshow. Can b used in slideshow.xml window id=2007
179 #define ACTION_ZOOM_IN 31 //!< zoom out picture during slideshow. Can b used in slideshow.xml window id=2007
180 #define ACTION_TOGGLE_SOURCE_DEST 32 //!< used to toggle between source view and destination view. Can be used in myfiles.xml window id=3
181 #define ACTION_SHOW_PLAYLIST 33 //!< used to toggle between current view and playlist view. Can b used in all mymusic xml files
182 #define ACTION_QUEUE_ITEM 34 //!< used to queue a item to the playlist. Can b used in all mymusic xml files
183 #define ACTION_REMOVE_ITEM 35 //!< not used anymore
184 #define ACTION_SHOW_FULLSCREEN 36 //!< not used anymore
185 #define ACTION_ZOOM_LEVEL_NORMAL 37 //!< zoom 1x picture during slideshow. Can b used in slideshow.xml window id=2007
186 #define ACTION_ZOOM_LEVEL_1 38 //!< zoom 2x picture during slideshow. Can b used in slideshow.xml window id=2007
187 #define ACTION_ZOOM_LEVEL_2 39 //!< zoom 3x picture during slideshow. Can b used in slideshow.xml window id=2007
188 #define ACTION_ZOOM_LEVEL_3 40 //!< zoom 4x picture during slideshow. Can b used in slideshow.xml window id=2007
189 #define ACTION_ZOOM_LEVEL_4 41 //!< zoom 5x picture during slideshow. Can b used in slideshow.xml window id=2007
190 #define ACTION_ZOOM_LEVEL_5 42 //!< zoom 6x picture during slideshow. Can b used in slideshow.xml window id=2007
191 #define ACTION_ZOOM_LEVEL_6 43 //!< zoom 7x picture during slideshow. Can b used in slideshow.xml window id=2007
192 #define ACTION_ZOOM_LEVEL_7 44 //!< zoom 8x picture during slideshow. Can b used in slideshow.xml window id=2007
193 #define ACTION_ZOOM_LEVEL_8 45 //!< zoom 9x picture during slideshow. Can b used in slideshow.xml window id=2007
194 #define ACTION_ZOOM_LEVEL_9 46 //!< zoom 10x picture during slideshow. Can b used in slideshow.xml window id=2007
196 #define ACTION_CALIBRATE_SWAP_ARROWS 47 //!< select next arrow. Can b used in: settingsScreenCalibration.xml windowid=11
197 #define ACTION_CALIBRATE_RESET 48 //!< reset calibration to defaults. Can b used in: `settingsScreenCalibration.xml` windowid=11/settingsUICalibration.xml windowid=10
198 #define ACTION_ANALOG_MOVE 49 //!< analog thumbstick move. Can b used in: `slideshow.xml` windowid=2007/settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10
199 //!< @note see also ACTION_ANALOG_MOVE_X, ACTION_ANALOG_MOVE_Y
200 #define ACTION_ROTATE_PICTURE_CW 50 //!< rotate current picture clockwise during slideshow. Can be used in slideshow.xml window id=2007
201 #define ACTION_ROTATE_PICTURE_CCW 51 //!< rotate current picture counterclockwise during slideshow. Can be used in slideshow.xml window id=2007
203 #define ACTION_SUBTITLE_DELAY_MIN 52 //!< Decrease subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005
204 #define ACTION_SUBTITLE_DELAY_PLUS 53 //!< Increase subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005
205 #define ACTION_AUDIO_DELAY_MIN 54 //!< Increase avsync delay. Can b used in videoFullScreen.xml window id=2005
206 #define ACTION_AUDIO_DELAY_PLUS 55 //!< Decrease avsync delay. Can b used in videoFullScreen.xml window id=2005
207 #define ACTION_AUDIO_NEXT_LANGUAGE 56 //!< Select next language in movie. Can b used in videoFullScreen.xml window id=2005
208 #define ACTION_CHANGE_RESOLUTION 57 //!< switch 2 next resolution. Can b used during screen calibration settingsScreenCalibration.xml windowid=11
210 #define REMOTE_0 58 //!< remote keys 0-9. are used by multiple windows
211 #define REMOTE_1 59 //!< for example in videoFullScreen.xml window id=2005 you can
212 #define REMOTE_2 60 //!< enter time (mmss) to jump to particular point in the movie
214 #define REMOTE_4 62 //!< with spincontrols you can enter 3digit number to quickly set
215 #define REMOTE_5 63 //!< spincontrol to desired value
221 #define ACTION_PLAY 68 //!< Unused at the moment
222 #define ACTION_PLAYER_PROCESS_INFO 69 //!< show player process info (video decoder, pixel format, pvr signal strength and the like
223 #define ACTION_SMALL_STEP_BACK 76 //!< jumps a few seconds back during playback of movie. Can b used in videoFullScreen.xml window id=2005
225 #define ACTION_PLAYER_FORWARD 77 //!< FF in current file played. global action, can be used anywhere
226 #define ACTION_PLAYER_REWIND 78 //!< RW in current file played. global action, can be used anywhere
227 #define ACTION_PLAYER_PLAY 79 //!< Play current song. Unpauses song and sets playspeed to 1x. global action, can be used anywhere
229 #define ACTION_DELETE_ITEM 80 //!< delete current selected item. Can be used in myfiles.xml window id=3 and in myvideoTitle.xml window id=25
230 #define ACTION_COPY_ITEM 81 //!< copy current selected item. Can be used in myfiles.xml window id=3
231 #define ACTION_MOVE_ITEM 82 //!< move current selected item. Can be used in myfiles.xml window id=3
232 #define ACTION_TAKE_SCREENSHOT 85 //!< take a screenshot
233 #define ACTION_RENAME_ITEM 87 //!< rename item
235 #define ACTION_VOLUME_UP 88
236 #define ACTION_VOLUME_DOWN 89
237 #define ACTION_VOLAMP 90
238 #define ACTION_MUTE 91
239 #define ACTION_NAV_BACK 92
240 #define ACTION_VOLAMP_UP 93
241 #define ACTION_VOLAMP_DOWN 94
243 #define ACTION_CREATE_EPISODE_BOOKMARK 95 //!< Creates an episode bookmark on the currently playing video file containing more than one episode
244 #define ACTION_CREATE_BOOKMARK 96 //!< Creates a bookmark of the currently playing video file
246 #define ACTION_CHAPTER_OR_BIG_STEP_FORWARD 97 //!< Goto the next chapter, if not available perform a big step forward
247 #define ACTION_CHAPTER_OR_BIG_STEP_BACK 98 //!< Goto the previous chapter, if not available perform a big step back
249 #define ACTION_CYCLE_SUBTITLE 99 //!< switch to next subtitle of movie, but will not enable/disable the subtitles. Can be used in videoFullScreen.xml window id=2005
251 #define ACTION_MOUSE_START 100
252 #define ACTION_MOUSE_LEFT_CLICK 100
253 #define ACTION_MOUSE_RIGHT_CLICK 101
254 #define ACTION_MOUSE_MIDDLE_CLICK 102
255 #define ACTION_MOUSE_DOUBLE_CLICK 103
256 #define ACTION_MOUSE_WHEEL_UP 104
257 #define ACTION_MOUSE_WHEEL_DOWN 105
258 #define ACTION_MOUSE_DRAG 106
259 #define ACTION_MOUSE_MOVE 107
260 #define ACTION_MOUSE_LONG_CLICK 108
261 #define ACTION_MOUSE_END 109
263 #define ACTION_BACKSPACE 110
264 #define ACTION_SCROLL_UP 111
265 #define ACTION_SCROLL_DOWN 112
266 #define ACTION_ANALOG_FORWARD 113
267 #define ACTION_ANALOG_REWIND 114
269 #define ACTION_MOVE_ITEM_UP 115 //!< move item up in playlist
270 #define ACTION_MOVE_ITEM_DOWN 116 //!< move item down in playlist
271 #define ACTION_CONTEXT_MENU 117 //!< pops up the context menu
273 // stuff for virtual keyboard shortcuts
274 #define ACTION_SHIFT 118 //!< stuff for virtual keyboard shortcuts
275 #define ACTION_SYMBOLS 119 //!< stuff for virtual keyboard shortcuts
276 #define ACTION_CURSOR_LEFT 120 //!< stuff for virtual keyboard shortcuts
277 #define ACTION_CURSOR_RIGHT 121 //!< stuff for virtual keyboard shortcuts
279 #define ACTION_BUILT_IN_FUNCTION 122
281 #define ACTION_SHOW_OSD_TIME 123 //!< displays current time, can be used in videoFullScreen.xml window id=2005
282 #define ACTION_ANALOG_SEEK_FORWARD 124 //!< seeks forward, and displays the seek bar.
283 #define ACTION_ANALOG_SEEK_BACK 125 //!< seeks backward, and displays the seek bar.
285 #define ACTION_VIS_PRESET_SHOW 126
286 #define ACTION_VIS_PRESET_NEXT 128
287 #define ACTION_VIS_PRESET_PREV 129
288 #define ACTION_VIS_PRESET_LOCK 130
289 #define ACTION_VIS_PRESET_RANDOM 131
290 #define ACTION_VIS_RATE_PRESET_PLUS 132
291 #define ACTION_VIS_RATE_PRESET_MINUS 133
293 #define ACTION_SHOW_VIDEOMENU 134
294 #define ACTION_ENTER 135
296 #define ACTION_INCREASE_RATING 136
297 #define ACTION_DECREASE_RATING 137
299 #define ACTION_NEXT_SCENE 138 //!< switch to next scene/cutpoint in movie
300 #define ACTION_PREV_SCENE 139 //!< switch to previous scene/cutpoint in movie
302 #define ACTION_NEXT_LETTER 140 //!< jump through a list or container by letter
303 #define ACTION_PREV_LETTER 141
305 #define ACTION_JUMP_SMS2 142 //!< jump direct to a particular letter using SMS-style input
306 #define ACTION_JUMP_SMS3 143
307 #define ACTION_JUMP_SMS4 144
308 #define ACTION_JUMP_SMS5 145
309 #define ACTION_JUMP_SMS6 146
310 #define ACTION_JUMP_SMS7 147
311 #define ACTION_JUMP_SMS8 148
312 #define ACTION_JUMP_SMS9 149
314 #define ACTION_FILTER_CLEAR 150
315 #define ACTION_FILTER_SMS2 151
316 #define ACTION_FILTER_SMS3 152
317 #define ACTION_FILTER_SMS4 153
318 #define ACTION_FILTER_SMS5 154
319 #define ACTION_FILTER_SMS6 155
320 #define ACTION_FILTER_SMS7 156
321 #define ACTION_FILTER_SMS8 157
322 #define ACTION_FILTER_SMS9 158
324 #define ACTION_FIRST_PAGE 159
325 #define ACTION_LAST_PAGE 160
327 #define ACTION_AUDIO_DELAY 161
328 #define ACTION_SUBTITLE_DELAY 162
329 #define ACTION_MENU 163
331 #define ACTION_SET_RATING 164
333 #define ACTION_RECORD 170
335 #define ACTION_PASTE 180
336 #define ACTION_NEXT_CONTROL 181
337 #define ACTION_PREV_CONTROL 182
338 #define ACTION_CHANNEL_SWITCH 183
339 #define ACTION_CHANNEL_UP 184
340 #define ACTION_CHANNEL_DOWN 185
341 #define ACTION_NEXT_CHANNELGROUP 186
342 #define ACTION_PREVIOUS_CHANNELGROUP 187
343 #define ACTION_PVR_PLAY 188
344 #define ACTION_PVR_PLAY_TV 189
345 #define ACTION_PVR_PLAY_RADIO 190
346 #define ACTION_PVR_SHOW_TIMER_RULE 191
348 #define ACTION_TOGGLE_FULLSCREEN 199 //!< switch 2 desktop resolution
349 #define ACTION_TOGGLE_WATCHED 200 //!< Toggle watched status (videos)
350 #define ACTION_SCAN_ITEM 201 //!< scan item
351 #define ACTION_TOGGLE_DIGITAL_ANALOG 202 //!< switch digital <-> analog
352 #define ACTION_RELOAD_KEYMAPS 203 //!< reloads CButtonTranslator's keymaps
353 #define ACTION_GUIPROFILE_BEGIN 204 //!< start the GUIControlProfiler running
355 #define ACTION_TELETEXT_RED 215 //!< Teletext Color button <b>Red</b> to control TopText
356 #define ACTION_TELETEXT_GREEN 216 //!< Teletext Color button <b>Green</b> to control TopText
357 #define ACTION_TELETEXT_YELLOW 217 //!< Teletext Color button <b>Yellow</b> to control TopText
358 #define ACTION_TELETEXT_BLUE 218 //!< Teletext Color button <b>Blue</b> to control TopText
360 #define ACTION_INCREASE_PAR 219
361 #define ACTION_DECREASE_PAR 220
363 #define ACTION_VSHIFT_UP 227 //!< shift up video image in VideoPlayer
364 #define ACTION_VSHIFT_DOWN 228 //!< shift down video image in VideoPlayer
366 #define ACTION_PLAYER_PLAYPAUSE 229 //!< Play/pause. If playing it pauses, if paused it plays.
368 #define ACTION_SUBTITLE_VSHIFT_UP 230 //!< shift up subtitles in VideoPlayer
369 #define ACTION_SUBTITLE_VSHIFT_DOWN 231 //!< shift down subtitles in VideoPlayer
370 #define ACTION_SUBTITLE_ALIGN 232 //!< toggle vertical alignment of subtitles
372 #define ACTION_FILTER 233
374 #define ACTION_SWITCH_PLAYER 234
376 #define ACTION_STEREOMODE_NEXT 235
377 #define ACTION_STEREOMODE_PREVIOUS 236
378 #define ACTION_STEREOMODE_TOGGLE 237 //!< turns 3d mode on/off
379 #define ACTION_STEREOMODE_SELECT 238
380 #define ACTION_STEREOMODE_TOMONO 239
381 #define ACTION_STEREOMODE_SET 240
383 #define ACTION_SETTINGS_RESET 241
384 #define ACTION_SETTINGS_LEVEL_CHANGE 242
386 #define ACTION_TRIGGER_OSD 243 //!< show autoclosing OSD. Can b used in videoFullScreen.xml window id=2005
387 #define ACTION_INPUT_TEXT 244
388 #define ACTION_VOLUME_SET 245
389 #define ACTION_TOGGLE_COMMSKIP 246
391 #define ACTION_TOUCH_TAP 401 //!< touch actions
392 #define ACTION_TOUCH_TAP_TEN 410 //!< touch actions
393 #define ACTION_TOUCH_LONGPRESS 411 //!< touch actions
394 #define ACTION_TOUCH_LONGPRESS_TEN 420 //!< touch actions
396 #define ACTION_GESTURE_NOTIFY 500
397 #define ACTION_GESTURE_BEGIN 501
398 #define ACTION_GESTURE_ZOOM 502 //!< sendaction with point and currentPinchScale (fingers together < 1.0 -> fingers apart > 1.0)
399 #define ACTION_GESTURE_ROTATE 503
400 #define ACTION_GESTURE_PAN 504
402 #define ACTION_GESTURE_SWIPE_LEFT 511
403 #define ACTION_GESTURE_SWIPE_LEFT_TEN 520
404 #define ACTION_GESTURE_SWIPE_RIGHT 521
405 #define ACTION_GESTURE_SWIPE_RIGHT_TEN 530
406 #define ACTION_GESTURE_SWIPE_UP 531
407 #define ACTION_GESTURE_SWIPE_UP_TEN 540
408 #define ACTION_GESTURE_SWIPE_DOWN 541
409 #define ACTION_GESTURE_SWIPE_DOWN_TEN 550
410 // 5xx is reserved for additional gesture actions
411 #define ACTION_GESTURE_END 599
413 // other, non-gesture actions
414 #define ACTION_ANALOG_MOVE_X 601 //!< analog thumbstick move, horizontal axis; see ACTION_ANALOG_MOVE
415 #define ACTION_ANALOG_MOVE_Y 602 //!< analog thumbstick move, vertical axis; see ACTION_ANALOG_MOVE
418 // The NOOP action can be specified to disable an input event. This is
419 // useful in user keyboard.xml etc to disable actions specified in the
420 // system mappings. ERROR action is used to play an error sound
421 #define ACTION_ERROR 998
422 #define ACTION_NOOP 999
424 #define ICON_TYPE_NONE 101
425 #define ICON_TYPE_PROGRAMS 102
426 #define ICON_TYPE_MUSIC 103
427 #define ICON_TYPE_PICTURES 104
428 #define ICON_TYPE_VIDEOS 105
429 #define ICON_TYPE_FILES 106
430 #define ICON_TYPE_WEATHER 107
431 #define ICON_TYPE_SETTINGS 109
439 \brief class encapsulating information regarding a particular user action to be sent to windows and controls
444 CAction(int actionID
, float amount1
= 1.0f
, float amount2
= 0.0f
, const std::string
&name
= "", unsigned int holdTime
= 0);
445 CAction(int actionID
, wchar_t unicode
);
446 CAction(int actionID
, unsigned int state
, float posX
, float posY
, float offsetX
, float offsetY
, const std::string
&name
= "");
447 CAction(int actionID
, const std::string
&name
, const CKey
&key
);
448 CAction(int actionID
, const std::string
&name
);
450 CAction(const CAction
& other
) { *this = other
; }
451 CAction
& operator=(const CAction
& rhs
);
453 /*! \brief Identifier of the action
454 \return id of the action
456 int GetID() const { return m_id
; };
458 /*! \brief Is this an action from the mouse
459 \return true if this is a mouse action, false otherwise
461 bool IsMouse() const { return (m_id
>= ACTION_MOUSE_START
&& m_id
<= ACTION_MOUSE_END
); };
463 bool IsGesture() const { return (m_id
>= ACTION_GESTURE_NOTIFY
&& m_id
<= ACTION_GESTURE_END
); };
465 /*! \brief Human-readable name of the action
466 \return name of the action
468 const std::string
&GetName() const { return m_name
; };
470 /*! \brief Text of the action if any
471 \return text payload of this action.
473 const std::string
&GetText() const { return m_text
; };
475 /*! \brief Set the text payload of the action
476 \param text to be set
478 void SetText(const std::string
&text
) { m_text
= text
; };
480 /*! \brief Get an amount associated with this action
481 \param zero-based index of amount to retrieve, defaults to 0
482 \return an amount associated with this action
484 float GetAmount(unsigned int index
= 0) const { return (index
< max_amounts
) ? m_amount
[index
] : 0; };
486 /*! \brief Unicode value associated with this action
487 \return unicode value associated with this action, for keyboard input.
489 wchar_t GetUnicode() const { return m_unicode
; };
491 /*! \brief Time in ms that the key has been held
492 \return time that the key has been held down in ms.
494 unsigned int GetHoldTime() const { return m_holdTime
; };
496 /*! \brief Time since last repeat in ms
497 \return time since last repeat in ms. Returns 0 if unknown.
499 float GetRepeat() const { return m_repeat
; };
501 /*! \brief Button code that triggered this action
504 unsigned int GetButtonCode() const { return m_buttonCode
; };
506 bool IsAnalog() const;
512 static const unsigned int max_amounts
= 4; // Must be at least 4.
513 float m_amount
[max_amounts
];
516 unsigned int m_holdTime
;
517 unsigned int m_buttonCode
;
523 \ingroup actionkeys, mouse
524 \brief Simple class for mouse events
529 CMouseEvent(int actionID
, int state
= 0, float offsetX
= 0, float offsetY
= 0)
551 CKey(uint32_t buttonCode
, uint8_t leftTrigger
= 0, uint8_t rightTrigger
= 0, float leftThumbX
= 0.0f
, float leftThumbY
= 0.0f
, float rightThumbX
= 0.0f
, float rightThumbY
= 0.0f
, float repeat
= 0.0f
);
552 CKey(uint32_t buttonCode
, unsigned int held
);
553 CKey(uint8_t vkey
, wchar_t unicode
, char ascii
, uint32_t modifiers
, unsigned int held
);
554 CKey(const CKey
& key
);
558 CKey
& operator=(const CKey
& key
);
559 uint8_t GetLeftTrigger() const;
560 uint8_t GetRightTrigger() const;
561 float GetLeftThumbX() const;
562 float GetLeftThumbY() const;
563 float GetRightThumbX() const;
564 float GetRightThumbY() const;
565 float GetRepeat() const;
566 bool FromKeyboard() const;
567 bool IsAnalogButton() const;
568 bool IsIRRemote() const;
569 void SetFromService(bool fromService
);
570 bool GetFromService() const { return m_fromService
; }
572 inline uint32_t GetButtonCode() const { return m_buttonCode
; }
573 inline uint8_t GetVKey() const { return m_vkey
; }
574 inline wchar_t GetUnicode() const { return m_unicode
; }
575 inline char GetAscii() const { return m_ascii
; }
576 inline uint32_t GetModifiers() const { return m_modifiers
; };
577 inline unsigned int GetHeld() const { return m_held
; }
580 MODIFIER_CTRL
= 0x00010000,
581 MODIFIER_SHIFT
= 0x00020000,
582 MODIFIER_ALT
= 0x00040000,
583 MODIFIER_RALT
= 0x00080000,
584 MODIFIER_SUPER
= 0x00100000,
585 MODIFIER_META
= 0X00200000,
586 MODIFIER_LONG
= 0X01000000
590 uint32_t m_buttonCode
;
594 uint32_t m_modifiers
;
597 uint8_t m_leftTrigger
;
598 uint8_t m_rightTrigger
;
603 float m_repeat
; // time since last keypress