]> git.sesse.net Git - vlc/blobdiff - include/vlc_keys.h
Add Hotkey to cycle through audio devices
[vlc] / include / vlc_keys.h
index 94c6f6be8722d93561da6bac4ac656b4b002af54..bbc3c1a1da76f910f99dacbe4e4b56fd86c9209a 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#if !defined( __LIBVLC__ )
+  #error You are not libvlc or one of its plugins. You cannot include this file
+#endif
+
+#ifndef _VLC_KEYS_H
+#define _VLC_KEYS_H 1
+
 #define KEY_MODIFIER         0xFF000000
 #define KEY_MODIFIER_ALT     0x01000000
 #define KEY_MODIFIER_SHIFT   0x02000000
 #define KEY_BACKSPACE        0x001C0000
 #define KEY_MOUSEWHEELUP     0x001D0000
 #define KEY_MOUSEWHEELDOWN   0x001E0000
+#define KEY_MOUSEWHEELLEFT   0x001F0000
+#define KEY_MOUSEWHEELRIGHT  0x00200000
+
+/* TODO:
+ * The media keys are only used in win32. Support for other OSes needs to
+ * be added */
+#define KEY_BROWSER_BACK     0x001F0000
+#define KEY_BROWSER_FORWARD  0x00200000
+#define KEY_BROWSER_REFRESH  0x00210000
+#define KEY_BROWSER_STOP     0x00220000
+#define KEY_BROWSER_SEARCH   0x00230000
+#define KEY_BROWSER_FAVORITES 0x00240000
+#define KEY_BROWSER_HOME     0x00250000
+#define KEY_VOLUME_MUTE      0x00260000
+#define KEY_VOLUME_DOWN      0x00270000
+#define KEY_VOLUME_UP        0x00280000
+#define KEY_MEDIA_NEXT_TRACK 0x00290000
+#define KEY_MEDIA_PREV_TRACK 0x002a0000
+#define KEY_MEDIA_STOP       0x002b0000
+#define KEY_MEDIA_PLAY_PAUSE 0x002c0000
 
 #define KEY_ASCII            0x0000007F
 #define KEY_UNSET            0
 
 typedef struct key_descriptor_s
 {
-    char *psz_key_string;
+    const char *psz_key_string;
     int i_key_code;
 } key_descriptor_t;
 
@@ -113,6 +140,16 @@ static const struct key_descriptor_s vlc_keys[] =
     { "Backspace", KEY_BACKSPACE },
     { "Mouse Wheel Up", KEY_MOUSEWHEELUP },
     { "Mouse Wheel Down", KEY_MOUSEWHEELDOWN },
+    { "0", '0' },
+    { "1", '1' },
+    { "2", '2' },
+    { "3", '3' },
+    { "4", '4' },
+    { "5", '5' },
+    { "6", '6' },
+    { "7", '7' },
+    { "8", '8' },
+    { "9", '9' },
     { "a", 'a' },
     { "b", 'b' },
     { "c", 'c' },
@@ -153,10 +190,24 @@ static const struct key_descriptor_s vlc_keys[] =
     { "\\", '\\' },
     { "[", '[' },
     { "]", ']' },
-    { "*", '*' }
+    { "*", '*' },
+    { "Browser Back", KEY_BROWSER_BACK },
+    { "Browser Forward", KEY_BROWSER_FORWARD },
+    { "Browser Refresh", KEY_BROWSER_REFRESH },
+    { "Browser Stop", KEY_BROWSER_STOP },
+    { "Browser Search", KEY_BROWSER_SEARCH },
+    { "Browser Favorites", KEY_BROWSER_FAVORITES },
+    { "Browser Home", KEY_BROWSER_HOME },
+    { "Volume Mute", KEY_VOLUME_MUTE },
+    { "Volume Down", KEY_VOLUME_DOWN },
+    { "Volume Up", KEY_VOLUME_UP },
+    { "Media Next Track", KEY_MEDIA_NEXT_TRACK },
+    { "Media Prev Track", KEY_MEDIA_PREV_TRACK },
+    { "Media Stop", KEY_MEDIA_STOP },
+    { "Media Play Pause", KEY_MEDIA_PLAY_PAUSE }
 };
 
-static inline char *KeyToString( int i_key )
+static inline const char *KeyToString( int i_key )
 {
     unsigned int i = 0;
     for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
@@ -192,7 +243,7 @@ static inline int StringToKey( char *psz_key )
 #define ACTIONID_NEXT                  7
 #define ACTIONID_SLOWER                8
 #define ACTIONID_FASTER                9
-#define ACTIONID_FULLSCREEN            10
+#define ACTIONID_TOGGLE_FULLSCREEN     10
 #define ACTIONID_VOL_UP                11
 #define ACTIONID_VOL_DOWN              12
 #define ACTIONID_NAV_ACTIVATE          13
@@ -200,14 +251,14 @@ static inline int StringToKey( char *psz_key )
 #define ACTIONID_NAV_DOWN              15
 #define ACTIONID_NAV_LEFT              16
 #define ACTIONID_NAV_RIGHT             17
-#define ACTIONID_JUMP_BACKWARD_3SEC    18
-#define ACTIONID_JUMP_FORWARD_3SEC     19
-#define ACTIONID_JUMP_BACKWARD_10SEC   20
-#define ACTIONID_JUMP_FORWARD_10SEC    21
-#define ACTIONID_JUMP_BACKWARD_1MIN    22
-#define ACTIONID_JUMP_FORWARD_1MIN     23
-#define ACTIONID_JUMP_BACKWARD_5MIN    24
-#define ACTIONID_JUMP_FORWARD_5MIN     25
+#define ACTIONID_JUMP_BACKWARD_EXTRASHORT 18
+#define ACTIONID_JUMP_FORWARD_EXTRASHORT  19
+#define ACTIONID_JUMP_BACKWARD_SHORT   20
+#define ACTIONID_JUMP_FORWARD_SHORT    21
+#define ACTIONID_JUMP_BACKWARD_MEDIUM  22
+#define ACTIONID_JUMP_FORWARD_MEDIUM   23
+#define ACTIONID_JUMP_BACKWARD_LONG    24
+#define ACTIONID_JUMP_FORWARD_LONG     25
 #define ACTIONID_POSITION              26
 #define ACTIONID_VOL_MUTE              27
 /* let ACTIONID_SET_BOOMARK* and ACTIONID_PLAY_BOOKMARK* be contiguous */
@@ -252,3 +303,37 @@ static inline int StringToKey( char *psz_key )
 #define ACTIONID_AUDIODELAY_DOWN       63
 #define ACTIONID_SNAPSHOT              64
 #define ACTIONID_RECORD                65
+#define ACTIONID_DISC_MENU             66
+#define ACTIONID_ASPECT_RATIO          67
+#define ACTIONID_CROP                  68
+#define ACTIONID_DEINTERLACE           69
+#define ACTIONID_ZOOM                  70
+#define ACTIONID_UNZOOM                71
+#define ACTIONID_CROP_TOP              72
+#define ACTIONID_UNCROP_TOP            73
+#define ACTIONID_CROP_LEFT             74
+#define ACTIONID_UNCROP_LEFT           75
+#define ACTIONID_CROP_BOTTOM           76
+#define ACTIONID_UNCROP_BOTTOM         77
+#define ACTIONID_CROP_RIGHT            78
+#define ACTIONID_UNCROP_RIGHT          79
+#define ACTIONID_DUMP                  80
+#define ACTIONID_RANDOM                81
+#define ACTIONID_LOOP                  82
+#define ACTIONID_WALLPAPER             83
+#define ACTIONID_LEAVE_FULLSCREEN      84
+#define ACTIONID_MENU_ON               85
+#define ACTIONID_MENU_OFF              86
+#define ACTIONID_MENU_RIGHT            87
+#define ACTIONID_MENU_LEFT             88
+#define ACTIONID_MENU_UP               89
+#define ACTIONID_MENU_DOWN             90
+#define ACTIONID_MENU_SELECT           91
+/* Zoom */
+#define ACTIONID_ZOOM_QUARTER          92
+#define ACTIONID_ZOOM_HALF             93
+#define ACTIONID_ZOOM_ORIGINAL         94
+#define ACTIONID_ZOOM_DOUBLE           95
+/* Cycle Through Audio Devices */
+#define ACTIONID_AUDIODEVICE_CYCLE     96
+#endif