]> git.sesse.net Git - vlc/blobdiff - include/vlc_keys.h
Merge branch 1.0-bugfix
[vlc] / include / vlc_keys.h
index 2d0f516915ee2728d382eeba160d7b62cd5f58d4..f78fd3a60dc1002da48d20b4b888716634e2dbcb 100644 (file)
  * 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
 
-#ifndef _VLC_KEYS_H
-#define _VLC_KEYS_H 1
+/**
+ * \file
+ * This file defines keys, functions and structures for hotkey handling in vlc
+ *
+ */
 
 #define KEY_MODIFIER         0xFF000000
 #define KEY_MODIFIER_ALT     0x01000000
@@ -106,6 +108,8 @@ static const struct key_descriptor_s vlc_modifiers[] =
     { "Meta", KEY_MODIFIER_META },
     { "Command", KEY_MODIFIER_COMMAND }
 };
+enum { vlc_num_modifiers=sizeof(vlc_modifiers)
+                        /sizeof(struct key_descriptor_s) };
 
 static const struct key_descriptor_s vlc_keys[] =
 {
@@ -176,21 +180,34 @@ static const struct key_descriptor_s vlc_keys[] =
     { "x", 'x' },
     { "y", 'y' },
     { "z", 'z' },
+    { "!", '!' },
+    { "\"", '\"' },
+    { "#", '#' },
+    { "$", '$' },
+    { "%", '%' },
+    { "&", '&' },
+    { "'", '\'' },
+    { "(", ')' },
+    { ")", ')' },
+    { "*", '*' },
     { "+", '+' },
-    { "=", '=' },
-    { "-", '-' },
     { ",", ',' },
+    { "-", '-' },
     { ".", '.' },
-    { "<", '<' },
-    { ">", '>' },
-    { "`", '`' },
     { "/", '/' },
+    { ":", ':' },
     { ";", ';' },
-    { "'", '\'' },
-    { "\\", '\\' },
+    { "<", '<' },
+    { "=", '=' },
+    { ">", '>' },
+    { "?", '?' },
+    { "@", '@' },
     { "[", '[' },
+    { "\\", '\\' },
     { "]", ']' },
-    { "*", '*' },
+    { "^", '^' },
+    { "_", '_' },
+    { "`", '`' },
     { "Browser Back", KEY_BROWSER_BACK },
     { "Browser Forward", KEY_BROWSER_FORWARD },
     { "Browser Refresh", KEY_BROWSER_REFRESH },
@@ -206,11 +223,12 @@ static const struct key_descriptor_s vlc_keys[] =
     { "Media Stop", KEY_MEDIA_STOP },
     { "Media Play Pause", KEY_MEDIA_PLAY_PAUSE }
 };
+enum { vlc_num_keys=sizeof(vlc_keys)/sizeof(struct key_descriptor_s) };
 
 static inline const char *KeyToString( int i_key )
 {
-    unsigned int i = 0;
-    for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
+    size_t i;
+    for ( i = 0; i < vlc_num_keys; ++i )
     {
         if ( vlc_keys[i].i_key_code == i_key )
         {
@@ -222,8 +240,8 @@ static inline const char *KeyToString( int i_key )
 
 static inline int StringToKey( char *psz_key )
 {
-    unsigned int i = 0;
-    for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
+    size_t i;
+    for ( i = 0; i < vlc_num_keys; ++i )
     {
         if ( !strcmp( vlc_keys[i].psz_key_string, psz_key ))
         {
@@ -233,7 +251,7 @@ static inline int StringToKey( char *psz_key )
     return 0;
 }
 
-enum {
+typedef enum vlc_key {
     ACTIONID_QUIT = 1,
     ACTIONID_PLAY_PAUSE,
     ACTIONID_PLAY,
@@ -259,6 +277,7 @@ enum {
     ACTIONID_JUMP_FORWARD_MEDIUM,
     ACTIONID_JUMP_BACKWARD_LONG,
     ACTIONID_JUMP_FORWARD_LONG,
+    ACTIONID_FRAME_NEXT,
     ACTIONID_POSITION,
     ACTIONID_VOL_MUTE,
 /* let ACTIONID_SET_BOOMARK* and ACTIONID_PLAY_BOOKMARK* be contiguous */
@@ -335,6 +354,15 @@ enum {
     ACTIONID_ZOOM_ORIGINAL,
     ACTIONID_ZOOM_DOUBLE,
     /* Cycle Through Audio Devices */
-    ACTIONID_AUDIODEVICE_CYCLE
-};
+    ACTIONID_AUDIODEVICE_CYCLE,
+    /* scaling */
+    ACTIONID_TOGGLE_AUTOSCALE,
+    ACTIONID_SCALE_UP,
+    ACTIONID_SCALE_DOWN,
+    /* */
+    ACTIONID_RATE_NORMAL,
+    ACTIONID_RATE_SLOWER_FINE,
+    ACTIONID_RATE_FASTER_FINE,
+
+} vlc_key_t;
 #endif