]> git.sesse.net Git - vlc/blobdiff - include/vlc_keys.h
* modules/audio_output/directx.c: backport of directx audio changes (13374). Needs...
[vlc] / include / vlc_keys.h
index d0cc39dc12cb90e024e5560804807ac5a8ca43ed..0fb52cc8d6a0d20c88a7fa5540478cb04b96817c 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
- * hotkeys.h: keycode defines
+ * vlc_keys.h: keycode defines
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: vlc_keys.h,v 1.3 2003/10/28 14:51:50 sam Exp $
+ * Copyright (C) 2003 the VideoLAN team
+ * $Id$
  *
- * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
+ * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #define KEY_F12              0x00120000
 #define KEY_HOME             0x00130000
 #define KEY_END              0x00140000
-#define KEY_MENU             0x00150000
-#define KEY_ESC              0x00160000
-#define KEY_PAGEUP           0x00170000
-#define KEY_PAGEDOWN         0x00180000
-#define KEY_TAB              0x00190000
-#define KEY_BACKSPACE        0x001A0000
+#define KEY_INSERT           0x00150000
+#define KEY_DELETE           0x00160000
+#define KEY_MENU             0x00170000
+#define KEY_ESC              0x00180000
+#define KEY_PAGEUP           0x00190000
+#define KEY_PAGEDOWN         0x001A0000
+#define KEY_TAB              0x001B0000
+#define KEY_BACKSPACE        0x001C0000
+#define KEY_MOUSEWHEELUP     0x001D0000
+#define KEY_MOUSEWHEELDOWN   0x001E0000
 
 #define KEY_ASCII            0x0000007F
 #define KEY_UNSET            0
@@ -67,7 +71,7 @@ typedef struct key_descriptor_s
 
 #define ADD_KEY(a) { a, *a }
 
-static const struct key_descriptor_s modifiers[] =
+static const struct key_descriptor_s vlc_modifiers[] =
 {
     { "Alt", KEY_MODIFIER_ALT },
     { "Shift", KEY_MODIFIER_SHIFT },
@@ -76,7 +80,7 @@ static const struct key_descriptor_s modifiers[] =
     { "Command", KEY_MODIFIER_COMMAND }
 };
 
-static const struct key_descriptor_s keys[] =
+static const struct key_descriptor_s vlc_keys[] =
 {
     { "Unset", KEY_UNSET },
     { "Left", KEY_LEFT },
@@ -99,12 +103,16 @@ static const struct key_descriptor_s keys[] =
     { "F12", KEY_F12 },
     { "Home", KEY_HOME },
     { "End", KEY_END },
+    { "Insert", KEY_INSERT },
+    { "Delete", KEY_DELETE },
     { "Menu", KEY_MENU },
     { "Esc", KEY_ESC },
     { "Page Up", KEY_PAGEUP },
     { "Page Down", KEY_PAGEDOWN },
     { "Tab", KEY_TAB },
     { "Backspace", KEY_BACKSPACE },
+    { "Mouse Wheel Up", KEY_MOUSEWHEELUP },
+    { "Mouse Wheel Down", KEY_MOUSEWHEELDOWN },
     { "a", 'a' },
     { "b", 'b' },
     { "c", 'c' },
@@ -132,23 +140,116 @@ static const struct key_descriptor_s keys[] =
     { "y", 'y' },
     { "z", 'z' },
     { "+", '+' },
+    { "=", '=' },
     { "-", '-' },
     { ",", ',' },
     { ".", '.' },
     { "<", '<' },
-    { ">", '>' }
+    { ">", '>' },
+    { "`", '`' },
+    { "/", '/' },
+    { ";", ';' },
+    { "'", '\'' },
+    { "\\", '\\' },
+    { "[", '[' },
+    { "]", ']' },
+    { "*", '*' }
 };
 
 static inline char *KeyToString( int i_key )
 {
     unsigned int i = 0;
-    for ( i = 0; i < sizeof(keys) / sizeof(key_descriptor_t); i++ )
+    for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
     {
-        if ( keys[i].i_key_code == i_key )
+        if ( vlc_keys[i].i_key_code == i_key )
         {
-            return keys[i].psz_key_string;
+            return vlc_keys[i].psz_key_string;
         }
     }
     return NULL;
 }
 
+static inline int StringToKey( char *psz_key )
+{
+    unsigned int i = 0;
+    for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
+    {
+        if ( !strcmp( vlc_keys[i].psz_key_string, psz_key ))
+        {
+            return vlc_keys[i].i_key_code;
+        }
+    }
+    return 0;
+}
+
+
+#define ACTIONID_QUIT                  1
+#define ACTIONID_PLAY_PAUSE            2
+#define ACTIONID_PLAY                  3
+#define ACTIONID_PAUSE                 4
+#define ACTIONID_STOP                  5
+#define ACTIONID_PREV                  6
+#define ACTIONID_NEXT                  7
+#define ACTIONID_SLOWER                8
+#define ACTIONID_FASTER                9
+#define ACTIONID_FULLSCREEN            10
+#define ACTIONID_VOL_UP                11
+#define ACTIONID_VOL_DOWN              12
+#define ACTIONID_NAV_ACTIVATE          13
+#define ACTIONID_NAV_UP                14
+#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_POSITION              26
+#define ACTIONID_VOL_MUTE              27
+/* let ACTIONID_SET_BOOMARK* and ACTIONID_PLAY_BOOKMARK* be contiguous */
+#define ACTIONID_SET_BOOKMARK1         28
+#define ACTIONID_SET_BOOKMARK2         29
+#define ACTIONID_SET_BOOKMARK3         39
+#define ACTIONID_SET_BOOKMARK4         31
+#define ACTIONID_SET_BOOKMARK5         32
+#define ACTIONID_SET_BOOKMARK6         33
+#define ACTIONID_SET_BOOKMARK7         34
+#define ACTIONID_SET_BOOKMARK8         35
+#define ACTIONID_SET_BOOKMARK9         36
+#define ACTIONID_SET_BOOKMARK10        37
+#define ACTIONID_PLAY_BOOKMARK1        38
+#define ACTIONID_PLAY_BOOKMARK2        39
+#define ACTIONID_PLAY_BOOKMARK3        40
+#define ACTIONID_PLAY_BOOKMARK4        41
+#define ACTIONID_PLAY_BOOKMARK5        42
+#define ACTIONID_PLAY_BOOKMARK6        43
+#define ACTIONID_PLAY_BOOKMARK7        44
+#define ACTIONID_PLAY_BOOKMARK8        45
+#define ACTIONID_PLAY_BOOKMARK9        46
+#define ACTIONID_PLAY_BOOKMARK10       47
+/* end of contiguous zone */
+#define ACTIONID_SUBDELAY_UP           48
+#define ACTIONID_SUBDELAY_DOWN         49
+#define ACTIONID_HISTORY_BACK          50
+#define ACTIONID_HISTORY_FORWARD       51
+#define ACTIONID_AUDIO_TRACK           52
+#define ACTIONID_SUBTITLE_TRACK        53
+#define ACTIONID_CUBESPEED_UP          54
+#define ACTIONID_CUBESPEED_DOWN        55
+#define ACTIONID_INTF_SHOW             56
+#define ACTIONID_INTF_HIDE             57
+/* chapter and title navigation */
+#define ACTIONID_TITLE_PREV            58
+#define ACTIONID_TITLE_NEXT            59
+#define ACTIONID_CHAPTER_PREV          60
+#define ACTIONID_CHAPTER_NEXT          61
+/* end of chapter and title navigation */
+#define ACTIONID_AUDIODELAY_UP         62
+#define ACTIONID_AUDIODELAY_DOWN       63
+#define ACTIONID_SNAPSHOT              64
+#define ACTIONID_RECORD                65
+#define ACTIONID_DISC_MENU             66