12 * Copyright (C) 2005-2008 Team XBMC
15 * This Program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
20 * This Program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with XBMC; see the file COPYING. If not, write to
27 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
28 * http://www.gnu.org/copyleft/gpl.html
32 #include "XBIRRemote.h"
33 #include <StdString.h>
35 // Analogue - don't change order
36 #define KEY_BUTTON_A 256
37 #define KEY_BUTTON_B 257
38 #define KEY_BUTTON_X 258
39 #define KEY_BUTTON_Y 259
40 #define KEY_BUTTON_BLACK 260
41 #define KEY_BUTTON_WHITE 261
42 #define KEY_BUTTON_LEFT_TRIGGER 262
43 #define KEY_BUTTON_RIGHT_TRIGGER 263
45 #define KEY_BUTTON_LEFT_THUMB_STICK 264
46 #define KEY_BUTTON_RIGHT_THUMB_STICK 265
48 #define KEY_BUTTON_RIGHT_THUMB_STICK_UP 266 // right thumb stick directions
49 #define KEY_BUTTON_RIGHT_THUMB_STICK_DOWN 267 // for defining different actions per direction
50 #define KEY_BUTTON_RIGHT_THUMB_STICK_LEFT 268
51 #define KEY_BUTTON_RIGHT_THUMB_STICK_RIGHT 269
53 // Digital - don't change order
54 #define KEY_BUTTON_DPAD_UP 270
55 #define KEY_BUTTON_DPAD_DOWN 271
56 #define KEY_BUTTON_DPAD_LEFT 272
57 #define KEY_BUTTON_DPAD_RIGHT 273
59 #define KEY_BUTTON_START 274
60 #define KEY_BUTTON_BACK 275
62 #define KEY_BUTTON_LEFT_THUMB_BUTTON 276
63 #define KEY_BUTTON_RIGHT_THUMB_BUTTON 277
65 #define KEY_BUTTON_LEFT_ANALOG_TRIGGER 278
66 #define KEY_BUTTON_RIGHT_ANALOG_TRIGGER 279
68 #define KEY_BUTTON_LEFT_THUMB_STICK_UP 280 // left thumb stick directions
69 #define KEY_BUTTON_LEFT_THUMB_STICK_DOWN 281 // for defining different actions per direction
70 #define KEY_BUTTON_LEFT_THUMB_STICK_LEFT 282
71 #define KEY_BUTTON_LEFT_THUMB_STICK_RIGHT 283
73 #define KEY_VMOUSE 0xEFFF
75 // 0xF000 -> 0xF200 is reserved for the keyboard; a keyboard press is either
76 #define KEY_VKEY 0xF000 // a virtual key/functional key e.g. cursor left
77 #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
78 #define KEY_UNICODE 0xF200 // another printable character whose range is not included in this KEY code
80 #define KEY_INVALID 0xFFFF
82 // actions that we have defined...
84 #define ACTION_MOVE_LEFT 1
85 #define ACTION_MOVE_RIGHT 2
86 #define ACTION_MOVE_UP 3
87 #define ACTION_MOVE_DOWN 4
88 #define ACTION_PAGE_UP 5
89 #define ACTION_PAGE_DOWN 6
90 #define ACTION_SELECT_ITEM 7
91 #define ACTION_HIGHLIGHT_ITEM 8
92 #define ACTION_PARENT_DIR 9
93 #define ACTION_PREVIOUS_MENU 10
94 #define ACTION_SHOW_INFO 11
96 #define ACTION_PAUSE 12
97 #define ACTION_STOP 13
98 #define ACTION_NEXT_ITEM 14
99 #define ACTION_PREV_ITEM 15
100 #define ACTION_FORWARD 16 // Can be used to specify specific action in a window, Playback control is handled in ACTION_PLAYER_*
101 #define ACTION_REWIND 17 // Can be used to specify specific action in a window, Playback control is handled in ACTION_PLAYER_*
103 #define ACTION_SHOW_GUI 18 // toggle between GUI and movie or GUI and visualisation.
104 #define ACTION_ASPECT_RATIO 19 // toggle quick-access zoom modes. Can b used in videoFullScreen.zml window id=2005
105 #define ACTION_STEP_FORWARD 20 // seek +1% in the movie. Can b used in videoFullScreen.xml window id=2005
106 #define ACTION_STEP_BACK 21 // seek -1% in the movie. Can b used in videoFullScreen.xml window id=2005
107 #define ACTION_BIG_STEP_FORWARD 22 // seek +10% in the movie. Can b used in videoFullScreen.xml window id=2005
108 #define ACTION_BIG_STEP_BACK 23 // seek -10% in the movie. Can b used in videoFullScreen.xml window id=2005
109 #define ACTION_SHOW_OSD 24 // show/hide OSD. Can b used in videoFullScreen.xml window id=2005
110 #define ACTION_SHOW_SUBTITLES 25 // turn subtitles on/off. Can b used in videoFullScreen.xml window id=2005
111 #define ACTION_NEXT_SUBTITLE 26 // switch to next subtitle of movie. Can b used in videoFullScreen.xml window id=2005
112 #define ACTION_SHOW_CODEC 27 // show information about file. Can b used in videoFullScreen.xml window id=2005 and in slideshow.xml window id=2007
113 #define ACTION_NEXT_PICTURE 28 // show next picture of slideshow. Can b used in slideshow.xml window id=2007
114 #define ACTION_PREV_PICTURE 29 // show previous picture of slideshow. Can b used in slideshow.xml window id=2007
115 #define ACTION_ZOOM_OUT 30 // zoom in picture during slideshow. Can b used in slideshow.xml window id=2007
116 #define ACTION_ZOOM_IN 31 // zoom out picture during slideshow. Can b used in slideshow.xml window id=2007
117 #define ACTION_TOGGLE_SOURCE_DEST 32 // used to toggle between source view and destination view. Can be used in myfiles.xml window id=3
118 #define ACTION_SHOW_PLAYLIST 33 // used to toggle between current view and playlist view. Can b used in all mymusic xml files
119 #define ACTION_QUEUE_ITEM 34 // used to queue a item to the playlist. Can b used in all mymusic xml files
120 #define ACTION_REMOVE_ITEM 35 // not used anymore
121 #define ACTION_SHOW_FULLSCREEN 36 // not used anymore
122 #define ACTION_ZOOM_LEVEL_NORMAL 37 // zoom 1x picture during slideshow. Can b used in slideshow.xml window id=2007
123 #define ACTION_ZOOM_LEVEL_1 38 // zoom 2x picture during slideshow. Can b used in slideshow.xml window id=2007
124 #define ACTION_ZOOM_LEVEL_2 39 // zoom 3x picture during slideshow. Can b used in slideshow.xml window id=2007
125 #define ACTION_ZOOM_LEVEL_3 40 // zoom 4x picture during slideshow. Can b used in slideshow.xml window id=2007
126 #define ACTION_ZOOM_LEVEL_4 41 // zoom 5x picture during slideshow. Can b used in slideshow.xml window id=2007
127 #define ACTION_ZOOM_LEVEL_5 42 // zoom 6x picture during slideshow. Can b used in slideshow.xml window id=2007
128 #define ACTION_ZOOM_LEVEL_6 43 // zoom 7x picture during slideshow. Can b used in slideshow.xml window id=2007
129 #define ACTION_ZOOM_LEVEL_7 44 // zoom 8x picture during slideshow. Can b used in slideshow.xml window id=2007
130 #define ACTION_ZOOM_LEVEL_8 45 // zoom 9x picture during slideshow. Can b used in slideshow.xml window id=2007
131 #define ACTION_ZOOM_LEVEL_9 46 // zoom 10x picture during slideshow. Can b used in slideshow.xml window id=2007
133 #define ACTION_CALIBRATE_SWAP_ARROWS 47 // select next arrow. Can b used in: settingsScreenCalibration.xml windowid=11
134 #define ACTION_CALIBRATE_RESET 48 // reset calibration to defaults. Can b used in: settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10
135 #define ACTION_ANALOG_MOVE 49 // analog thumbstick move. Can b used in: slideshow.xml window id=2007/settingsScreenCalibration.xml windowid=11/settingsUICalibration.xml windowid=10
136 #define ACTION_ROTATE_PICTURE 50 // rotate current picture during slideshow. Can b used in slideshow.xml window id=2007
137 #define ACTION_CLOSE_DIALOG 51 // action for closing the dialog. Can b used in any dialog
138 #define ACTION_SUBTITLE_DELAY_MIN 52 // Decrease subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005
139 #define ACTION_SUBTITLE_DELAY_PLUS 53 // Increase subtitle/movie Delay. Can b used in videoFullScreen.xml window id=2005
140 #define ACTION_AUDIO_DELAY_MIN 54 // Increase avsync delay. Can b used in videoFullScreen.xml window id=2005
141 #define ACTION_AUDIO_DELAY_PLUS 55 // Decrease avsync delay. Can b used in videoFullScreen.xml window id=2005
142 #define ACTION_AUDIO_NEXT_LANGUAGE 56 // Select next language in movie. Can b used in videoFullScreen.xml window id=2005
143 #define ACTION_CHANGE_RESOLUTION 57 // switch 2 next resolution. Can b used during screen calibration settingsScreenCalibration.xml windowid=11
145 #define REMOTE_0 58 // remote keys 0-9. are used by multiple windows
146 #define REMOTE_1 59 // for example in videoFullScreen.xml window id=2005 you can
147 #define REMOTE_2 60 // enter time (mmss) to jump to particular point in the movie
149 #define REMOTE_4 62 // with spincontrols you can enter 3digit number to quickly set
150 #define REMOTE_5 63 // spincontrol to desired value
156 #define ACTION_PLAY 68 // Unused at the moment
157 #define ACTION_OSD_SHOW_LEFT 69 // Move left in OSD. Can b used in videoFullScreen.xml window id=2005
158 #define ACTION_OSD_SHOW_RIGHT 70 // Move right in OSD. Can b used in videoFullScreen.xml window id=2005
159 #define ACTION_OSD_SHOW_UP 71 // Move up in OSD. Can b used in videoFullScreen.xml window id=2005
160 #define ACTION_OSD_SHOW_DOWN 72 // Move down in OSD. Can b used in videoFullScreen.xml window id=2005
161 #define ACTION_OSD_SHOW_SELECT 73 // toggle/select option in OSD. Can b used in videoFullScreen.xml window id=2005
162 #define ACTION_OSD_SHOW_VALUE_PLUS 74 // increase value of current option in OSD. Can b used in videoFullScreen.xml window id=2005
163 #define ACTION_OSD_SHOW_VALUE_MIN 75 // decrease value of current option in OSD. Can b used in videoFullScreen.xml window id=2005
164 #define ACTION_SMALL_STEP_BACK 76 // jumps a few seconds back during playback of movie. Can b used in videoFullScreen.xml window id=2005
166 #define ACTION_PLAYER_FORWARD 77 // FF in current file played. global action, can be used anywhere
167 #define ACTION_PLAYER_REWIND 78 // RW in current file played. global action, can be used anywhere
168 #define ACTION_PLAYER_PLAY 79 // Play current song. Unpauses song and sets playspeed to 1x. global action, can be used anywhere
170 #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
171 #define ACTION_COPY_ITEM 81 // copy current selected item. Can be used in myfiles.xml window id=3
172 #define ACTION_MOVE_ITEM 82 // move current selected item. Can be used in myfiles.xml window id=3
173 #define ACTION_SHOW_MPLAYER_OSD 83 // toggles mplayers OSD. Can be used in videofullscreen.xml window id=2005
174 #define ACTION_OSD_HIDESUBMENU 84 // removes an OSD sub menu. Can be used in videoOSD.xml window id=2901
175 #define ACTION_TAKE_SCREENSHOT 85 // take a screenshot
176 #define ACTION_RENAME_ITEM 87 // rename item
178 #define ACTION_VOLUME_UP 88
179 #define ACTION_VOLUME_DOWN 89
180 #define ACTION_MUTE 91
182 #define ACTION_MOUSE_START 100
183 #define ACTION_MOUSE_LEFT_CLICK 100
184 #define ACTION_MOUSE_RIGHT_CLICK 101
185 #define ACTION_MOUSE_MIDDLE_CLICK 102
186 #define ACTION_MOUSE_DOUBLE_CLICK 103
187 #define ACTION_MOUSE_WHEEL_UP 104
188 #define ACTION_MOUSE_WHEEL_DOWN 105
189 #define ACTION_MOUSE_DRAG 106
190 #define ACTION_MOUSE_MOVE 107
191 #define ACTION_MOUSE_END 109
193 #define ACTION_BACKSPACE 110
194 #define ACTION_SCROLL_UP 111
195 #define ACTION_SCROLL_DOWN 112
196 #define ACTION_ANALOG_FORWARD 113
197 #define ACTION_ANALOG_REWIND 114
199 #define ACTION_MOVE_ITEM_UP 115 // move item up in playlist
200 #define ACTION_MOVE_ITEM_DOWN 116 // move item down in playlist
201 #define ACTION_CONTEXT_MENU 117 // pops up the context menu
204 // stuff for virtual keyboard shortcuts
205 #define ACTION_SHIFT 118
206 #define ACTION_SYMBOLS 119
207 #define ACTION_CURSOR_LEFT 120
208 #define ACTION_CURSOR_RIGHT 121
210 #define ACTION_BUILT_IN_FUNCTION 122
212 #define ACTION_SHOW_OSD_TIME 123 // displays current time, can be used in videoFullScreen.xml window id=2005
213 #define ACTION_ANALOG_SEEK_FORWARD 124 // seeks forward, and displays the seek bar.
214 #define ACTION_ANALOG_SEEK_BACK 125 // seeks backward, and displays the seek bar.
216 #define ACTION_VIS_PRESET_SHOW 126
217 #define ACTION_VIS_PRESET_LIST 127
218 #define ACTION_VIS_PRESET_NEXT 128
219 #define ACTION_VIS_PRESET_PREV 129
220 #define ACTION_VIS_PRESET_LOCK 130
221 #define ACTION_VIS_PRESET_RANDOM 131
222 #define ACTION_VIS_RATE_PRESET_PLUS 132
223 #define ACTION_VIS_RATE_PRESET_MINUS 133
225 #define ACTION_SHOW_VIDEOMENU 134
226 #define ACTION_ENTER 135
228 #define ACTION_INCREASE_RATING 136
229 #define ACTION_DECREASE_RATING 137
231 #define ACTION_NEXT_SCENE 138 // switch to next scene/cutpoint in movie
232 #define ACTION_PREV_SCENE 139 // switch to previous scene/cutpoint in movie
234 #define ACTION_NEXT_LETTER 140 // jump through a list or container by letter
235 #define ACTION_PREV_LETTER 141
237 #define ACTION_JUMP_SMS2 142 // jump direct to a particular letter using SMS-style input
238 #define ACTION_JUMP_SMS3 143
239 #define ACTION_JUMP_SMS4 144
240 #define ACTION_JUMP_SMS5 145
241 #define ACTION_JUMP_SMS6 146
242 #define ACTION_JUMP_SMS7 147
243 #define ACTION_JUMP_SMS8 148
244 #define ACTION_JUMP_SMS9 149
246 #define ACTION_FILTER_CLEAR 150
247 #define ACTION_FILTER_SMS2 151
248 #define ACTION_FILTER_SMS3 152
249 #define ACTION_FILTER_SMS4 153
250 #define ACTION_FILTER_SMS5 154
251 #define ACTION_FILTER_SMS6 155
252 #define ACTION_FILTER_SMS7 156
253 #define ACTION_FILTER_SMS8 157
254 #define ACTION_FILTER_SMS9 158
256 #define ACTION_FIRST_PAGE 159
257 #define ACTION_LAST_PAGE 160
259 #define ACTION_AUDIO_DELAY 161
260 #define ACTION_SUBTITLE_DELAY 162
262 #define ACTION_RECORD 170
264 #define ACTION_PASTE 180
265 #define ACTION_NEXT_CONTROL 181
266 #define ACTION_PREV_CONTROL 182
267 #define ACTION_CHANNEL_SWITCH 183
269 #define ACTION_TOGGLE_FULLSCREEN 199 // switch 2 desktop resolution
270 #define ACTION_TOGGLE_WATCHED 200 // Toggle watched status (videos)
271 #define ACTION_SCAN_ITEM 201 // scan item
272 #define ACTION_TOGGLE_DIGITAL_ANALOG 202 // switch digital <-> analog
273 #define ACTION_RELOAD_KEYMAPS 203 // reloads CButtonTranslator's keymaps
274 #define ACTION_GUIPROFILE_BEGIN 204 // start the GUIControlProfiler running
276 #define ACTION_TELETEXT_RED 215 // Teletext Color buttons to control TopText
277 #define ACTION_TELETEXT_GREEN 216 // " " " " " "
278 #define ACTION_TELETEXT_YELLOW 217 // " " " " " "
279 #define ACTION_TELETEXT_BLUE 218 // " " " " " "
281 #define ACTION_INCREASE_PAR 219
282 #define ACTION_DECREASE_PAR 220
284 #define ACTION_GESTURE_NOTIFY 221
285 #define ACTION_GESTURE_BEGIN 222
286 #define ACTION_GESTURE_ZOOM 223
287 #define ACTION_GESTURE_ROTATE 224
288 #define ACTION_GESTURE_PAN 225
289 #define ACTION_GESTURE_END 226
290 #define ACTION_VSHIFT_UP 227 // shift up video image in DVDPlayer
291 #define ACTION_VSHIFT_DOWN 228 // shift down video image in DVDPlayer
293 #define ACTION_PLAYER_PLAYPAUSE 227 // Play/pause. If playing it pauses, if paused it plays.
295 // Window ID defines to make the code a bit more readable
296 #define WINDOW_INVALID 9999
297 #define WINDOW_HOME 10000
298 #define WINDOW_PROGRAMS 10001
299 #define WINDOW_PICTURES 10002
300 #define WINDOW_FILES 10003
301 #define WINDOW_SETTINGS_MENU 10004
302 #define WINDOW_MUSIC 10005 // virtual window to return the music start window.
303 #define WINDOW_VIDEOS 10006
304 #define WINDOW_SYSTEM_INFORMATION 10007
305 #define WINDOW_TEST_PATTERN 10008
306 #define WINDOW_SCREEN_CALIBRATION 10011
308 #define WINDOW_SETTINGS_MYPICTURES 10012
309 #define WINDOW_SETTINGS_MYPROGRAMS 10013
310 #define WINDOW_SETTINGS_MYWEATHER 10014
311 #define WINDOW_SETTINGS_MYMUSIC 10015
312 #define WINDOW_SETTINGS_SYSTEM 10016
313 #define WINDOW_SETTINGS_MYVIDEOS 10017
314 #define WINDOW_SETTINGS_NETWORK 10018
315 #define WINDOW_SETTINGS_APPEARANCE 10019
316 #define WINDOW_SETTINGS_MYTV 10020
318 #define WINDOW_VIDEO_FILES 10024
319 #define WINDOW_VIDEO_NAV 10025
320 #define WINDOW_VIDEO_PLAYLIST 10028
322 #define WINDOW_LOGIN_SCREEN 10029
323 #define WINDOW_SCRIPTS 10030
324 #define WINDOW_SETTINGS_PROFILES 10034
326 #define WINDOW_ADDON_BROWSER 10040
328 #define WINDOW_DIALOG_YES_NO 10100
329 #define WINDOW_DIALOG_PROGRESS 10101
330 #define WINDOW_DIALOG_KEYBOARD 10103
331 #define WINDOW_DIALOG_VOLUME_BAR 10104
332 #define WINDOW_DIALOG_SUB_MENU 10105
333 #define WINDOW_DIALOG_CONTEXT_MENU 10106
334 #define WINDOW_DIALOG_KAI_TOAST 10107
335 #define WINDOW_DIALOG_NUMERIC 10109
336 #define WINDOW_DIALOG_GAMEPAD 10110
337 #define WINDOW_DIALOG_BUTTON_MENU 10111
338 #define WINDOW_DIALOG_MUSIC_SCAN 10112
339 #define WINDOW_DIALOG_MUTE_BUG 10113
340 #define WINDOW_DIALOG_PLAYER_CONTROLS 10114
341 #define WINDOW_DIALOG_SEEK_BAR 10115
342 #define WINDOW_DIALOG_MUSIC_OSD 10120
343 #define WINDOW_DIALOG_VIS_SETTINGS 10121
344 #define WINDOW_DIALOG_VIS_PRESET_LIST 10122
345 #define WINDOW_DIALOG_VIDEO_OSD_SETTINGS 10123
346 #define WINDOW_DIALOG_AUDIO_OSD_SETTINGS 10124
347 #define WINDOW_DIALOG_VIDEO_BOOKMARKS 10125
348 #define WINDOW_DIALOG_FILE_BROWSER 10126
349 #define WINDOW_DIALOG_NETWORK_SETUP 10128
350 #define WINDOW_DIALOG_MEDIA_SOURCE 10129
351 #define WINDOW_DIALOG_PROFILE_SETTINGS 10130
352 #define WINDOW_DIALOG_LOCK_SETTINGS 10131
353 #define WINDOW_DIALOG_CONTENT_SETTINGS 10132
354 #define WINDOW_DIALOG_VIDEO_SCAN 10133
355 #define WINDOW_DIALOG_FAVOURITES 10134
356 #define WINDOW_DIALOG_SONG_INFO 10135
357 #define WINDOW_DIALOG_SMART_PLAYLIST_EDITOR 10136
358 #define WINDOW_DIALOG_SMART_PLAYLIST_RULE 10137
359 #define WINDOW_DIALOG_BUSY 10138
360 #define WINDOW_DIALOG_PICTURE_INFO 10139
361 #define WINDOW_DIALOG_ADDON_SETTINGS 10140
362 #define WINDOW_DIALOG_ACCESS_POINTS 10141
363 #define WINDOW_DIALOG_FULLSCREEN_INFO 10142
364 #define WINDOW_DIALOG_KARAOKE_SONGSELECT 10143
365 #define WINDOW_DIALOG_KARAOKE_SELECTOR 10144
366 #define WINDOW_DIALOG_SLIDER 10145
367 #define WINDOW_DIALOG_ADDON_INFO 10146
368 #define WINDOW_DIALOG_TEXT_VIEWER 10147
370 #define WINDOW_MUSIC_PLAYLIST 10500
371 #define WINDOW_MUSIC_FILES 10501
372 #define WINDOW_MUSIC_NAV 10502
373 #define WINDOW_MUSIC_PLAYLIST_EDITOR 10503
375 // PVR related Window and Dialog ID's
376 #define WINDOW_TV 10600
377 #define WINDOW_DIALOG_PVR_GUIDE_INFO 10601
378 #define WINDOW_DIALOG_PVR_RECORDING_INFO 10602
379 #define WINDOW_DIALOG_PVR_TIMER_SETTING 10603
380 #define WINDOW_DIALOG_PVR_GROUP_MANAGER 10604
381 #define WINDOW_DIALOG_PVR_CHANNEL_MANAGER 10605
382 #define WINDOW_DIALOG_PVR_GUIDE_SEARCH 10606
383 #define WINDOW_DIALOG_PVR_CHANNEL_SCAN 10607
384 #define WINDOW_DIALOG_PVR_UPDATE_PROGRESS 10608
385 #define WINDOW_DIALOG_PVR_OSD_CHANNELS 10609
386 #define WINDOW_DIALOG_PVR_OSD_GUIDE 10610
387 #define WINDOW_DIALOG_PVR_OSD_DIRECTOR 10611
388 #define WINDOW_DIALOG_PVR_OSD_CUTTER 10612
389 #define WINDOW_DIALOG_OSD_TELETEXT 10613
390 #define WINDOW_DIALOG_EPG_SCAN 10614
392 //#define WINDOW_VIRTUAL_KEYBOARD 11000
393 #define WINDOW_DIALOG_SELECT 12000
394 #define WINDOW_MUSIC_INFO 12001
395 #define WINDOW_DIALOG_OK 12002
396 #define WINDOW_VIDEO_INFO 12003
397 #define WINDOW_FULLSCREEN_VIDEO 12005
398 #define WINDOW_VISUALISATION 12006
399 #define WINDOW_SLIDESHOW 12007
400 #define WINDOW_DIALOG_FILESTACKING 12008
401 #define WINDOW_KARAOKELYRICS 12009
402 #define WINDOW_WEATHER 12600
403 #define WINDOW_SCREENSAVER 12900
404 #define WINDOW_OSD 12901
406 #define WINDOW_VIDEO_MENU 12902
407 #define WINDOW_MUSIC_OVERLAY 12903
408 #define WINDOW_VIDEO_OVERLAY 12904
409 #define WINDOW_VIDEO_TIME_SEEK 12905 // virtual window for time seeking during fullscreen video
411 #define WINDOW_START 12998 // first window to load
412 #define WINDOW_STARTUP_ANIM 12999 // for startup animations
414 // WINDOW_ID's from 13000 to 13099 reserved for Python
416 #define WINDOW_PYTHON_START 13000
417 #define WINDOW_PYTHON_END 13099
419 // WINDOW_ID's from 14000 to 14099 reserved for Addons
421 #define WINDOW_ADDON_START 14000
422 #define WINDOW_ADDON_END 14099
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
437 \brief class encapsulating information regarding a particular user action to be sent to windows and controls
442 CAction(int actionID, float amount1 = 1.0f, float amount2 = 0.0f, const CStdString &name = "");
443 CAction(int actionID, wchar_t unicode);
444 CAction(int actionID, unsigned int state, float posX, float posY, float offsetX, float offsetY);
445 CAction(int actionID, const CStdString &name, const CKey &key);
447 /*! \brief Identifier of the action
448 \return id of the action
450 int GetID() const { return m_id; };
452 /*! \brief Is this an action from the mouse
453 \return true if this is a mouse action, false otherwise
455 bool IsMouse() const { return (m_id >= ACTION_MOUSE_START && m_id <= ACTION_MOUSE_END); };
457 bool IsGesture() const { return (m_id >= ACTION_GESTURE_NOTIFY && m_id <= ACTION_GESTURE_END); };
459 /*! \brief Human-readable name of the action
460 \return name of the action
462 const CStdString &GetName() const { return m_name; };
464 /*! \brief Get an amount associated with this action
465 \param zero-based index of amount to retrieve, defaults to 0
466 \return an amount associated with this action
468 float GetAmount(unsigned int index = 0) const { return (index < max_amounts) ? m_amount[index] : 0; };
470 /*! \brief Unicode value associated with this action
471 \return unicode value associated with this action, for keyboard input.
473 wchar_t GetUnicode() const { return m_unicode; };
475 /*! \brief Time in ms that the key has been held
476 \return time that the key has been held down in ms.
478 unsigned int GetHoldTime() const { return m_holdTime; };
480 /*! \brief Time since last repeat in ms
481 \return time since last repeat in ms. Returns 0 if unknown.
483 float GetRepeat() const { return m_repeat; };
485 /*! \brief Button code that triggered this action
488 unsigned int GetButtonCode() const { return m_buttonCode; };
494 static const unsigned int max_amounts = 4; // Must be at least 4.
495 float m_amount[max_amounts];
498 unsigned int m_holdTime;
499 unsigned int m_buttonCode;
504 \ingroup actionkeys, mouse
505 \brief Simple class for mouse events
510 CMouseEvent(int actionID, int state = 0, float offsetX = 0, float offsetY = 0)
532 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);
533 CKey(uint32_t buttonCode, unsigned int held);
534 CKey(uint8_t vkey, wchar_t unicode, char ascii, uint32_t modifiers, unsigned int held);
535 CKey(const CKey& key);
538 const CKey& operator=(const CKey& key);
539 uint8_t GetLeftTrigger() const;
540 uint8_t GetRightTrigger() const;
541 float GetLeftThumbX() const;
542 float GetLeftThumbY() const;
543 float GetRightThumbX() const;
544 float GetRightThumbY() const;
545 float GetRepeat() const;
546 bool FromKeyboard() const;
547 bool IsAnalogButton() const;
548 bool IsIRRemote() const;
549 void SetFromHttpApi(bool);
550 bool GetFromHttpApi() const;
552 inline uint32_t GetButtonCode() const { return m_buttonCode; }
553 inline uint8_t GetVKey() const { return m_vkey; }
554 inline wchar_t GetUnicode() const { return m_unicode; }
555 inline char GetAscii() const { return m_ascii; }
556 inline uint32_t GetModifiers() const { return m_modifiers; };
557 inline unsigned int GetHeld() const { return m_held; }
560 MODIFIER_CTRL = 0x00010000,
561 MODIFIER_SHIFT = 0x00020000,
562 MODIFIER_ALT = 0x00040000,
563 MODIFIER_RALT = 0x00080000,
564 MODIFIER_SUPER = 0x00100000
570 uint32_t m_buttonCode;
574 uint32_t m_modifiers;
577 uint8_t m_leftTrigger;
578 uint8_t m_rightTrigger;
583 float m_repeat; // time since last keypress