]> git.sesse.net Git - vlc/blobdiff - include/vlc_keys.h
* include/vlc_keys.h: Fixed a warning in StringToKey().
[vlc] / include / vlc_keys.h
index d0cc39dc12cb90e024e5560804807ac5a8ca43ed..19f19f1e6bcccdc298393179b47fed512878ab76 100644 (file)
@@ -2,7 +2,7 @@
  * hotkeys.h: keycode defines
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlc_keys.h,v 1.3 2003/10/28 14:51:50 sam Exp $
+ * $Id: vlc_keys.h,v 1.9 2003/11/16 22:10:16 sam Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -67,7 +67,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 +76,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 },
@@ -132,23 +132,69 @@ 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_10SEC   18
+#define ACTIONID_JUMP_FORWARD_10SEC    19
+#define ACTIONID_JUMP_BACKWARD_1MIN    20
+#define ACTIONID_JUMP_FORWARD_1MIN     21
+#define ACTIONID_JUMP_BACKWARD_5MIN    22
+#define ACTIONID_JUMP_FORWARD_5MIN     23