]> git.sesse.net Git - vlc/commitdiff
KEY_SPACE = 32, simplify several outputs and interfaces
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 7 Oct 2009 16:48:07 +0000 (19:48 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 7 Oct 2009 16:48:07 +0000 (19:48 +0300)
14 files changed:
include/vlc_keys.h
modules/control/globalhotkeys/xcb.c
modules/gui/beos/VideoOutput.cpp
modules/gui/macosx/intf.m
modules/gui/qt4/util/customwidgets.cpp
modules/gui/skins2/controls/ctrl_tree.cpp
modules/gui/skins2/win32/win32_loop.cpp
modules/gui/skins2/x11/x11_loop.cpp
modules/video_output/aa.c
modules/video_output/caca.c
modules/video_output/msw/events.c
modules/video_output/sdl.c
modules/video_output/xcb/keys.c
src/libvlc-module.c

index 4f7fe397a0f4e091644f0a66bbd7fedd055ca156..cc2cca5380c70f43d88e2d6ceb4d12eaf049860a 100644 (file)
@@ -47,7 +47,6 @@
 #define KEY_RIGHT            0x00220000
 #define KEY_UP               0x00230000
 #define KEY_DOWN             0x00240000
-#define KEY_SPACE            0x00250000
 #define KEY_ENTER            0x00260000
 #define KEY_F1               0x00270000
 #define KEY_F2               0x00280000
@@ -114,6 +113,7 @@ enum { vlc_num_modifiers=sizeof(vlc_modifiers)
 static const struct key_descriptor_s vlc_keys[] =
 {
     { "Unset", KEY_UNSET },
+    { "Space", ' ' },
     { "!", '!' },
     { "\"", '\"' },
     { "#", '#' },
@@ -182,7 +182,6 @@ static const struct key_descriptor_s vlc_keys[] =
     { "Right", KEY_RIGHT },
     { "Up", KEY_UP },
     { "Down", KEY_DOWN },
-    { "Space", KEY_SPACE },
     { "Enter", KEY_ENTER },
     { "F1", KEY_F1 },
     { "F2", KEY_F2 },
index 348205f427829e404a6670cc0c2244d33d41bfa1..ca8296f3cc02f9c83c1ba8e1ce757227a442f1d2 100644 (file)
@@ -230,7 +230,6 @@ static const struct
 
     { XK_Return, KEY_ENTER },
     { XK_KP_Enter, KEY_ENTER },
-    { XK_space, KEY_SPACE },
     { XK_Escape, KEY_ESC },
 
     { XK_Menu, KEY_MENU },
@@ -258,16 +257,16 @@ static const struct
 };
 static xcb_keysym_t GetX11Key( unsigned i_vlc )
 {
+    /* X11 and VLC use ASCII for printable ASCII characters */
+    if( i_vlc >= 32 && i_vlc <= 127 )
+        return i_vlc;
+
     for( int i = 0; x11keys_to_vlckeys[i].i_vlc != 0; i++ )
     {
         if( x11keys_to_vlckeys[i].i_vlc == i_vlc )
             return x11keys_to_vlckeys[i].i_x11;
     }
 
-    /* Copied from xcb, it seems that xcb use ascii code for ascii characters */
-    if( isascii( i_vlc ) )
-        return i_vlc;
-
     return XK_VoidSymbol;
 }
 
index cb1805bebcba5f790c35b8025fb28364e822a0f6..e6538bd8544083dd11c6d47f25f6f611d112b3cb 100644 (file)
@@ -112,7 +112,7 @@ static const int beos_keys[][2] =
     { B_RIGHT_ARROW, KEY_RIGHT },
     { B_UP_ARROW,    KEY_UP },
     { B_DOWN_ARROW,  KEY_DOWN },
-    { B_SPACE,       KEY_SPACE },
+    { B_SPACE,       ' ' },
     { B_ENTER,       KEY_ENTER },
     { B_F1_KEY,      KEY_F1 },
     { B_F2_KEY,      KEY_F2 },
index 1d49df70ef06f13cef66bd2c126ad94f7142f19b..d099e761cf2f4c8086fa28247946a29522be4d42 100644 (file)
@@ -1279,7 +1279,6 @@ static struct
     { NSCarriageReturnCharacter, KEY_ENTER },
     { NSEnterCharacter, KEY_ENTER },
     { NSBackspaceCharacter, KEY_BACKSPACE },
-    { (unichar) ' ', KEY_SPACE },
     { (unichar) 0x1b, KEY_ESC },
     {0,0}
 };
index 9004517d89f65031efe10d1ca4704b1072bc2124..c02945cbd807b87d27f752c8e5cc5049d4021974 100644 (file)
@@ -174,7 +174,7 @@ int qtEventToVLCKey( QKeyEvent *e )
         HANDLE( Key_Right, KEY_RIGHT );
         HANDLE( Key_Up, KEY_UP );
         HANDLE( Key_Down, KEY_DOWN );
-        HANDLE( Key_Space, KEY_SPACE );
+        HANDLE( Key_Space, ' ' );
         HANDLE( Key_Escape, KEY_ESC );
         HANDLE( Key_Return, KEY_ENTER );
         HANDLE( Key_Enter, KEY_ENTER );
index 9879e1567cce485d9a0f2337a38fb36f5bebf8cf..4819646b29e2ba83fcaf5288f8bf210325e2bb1b 100644 (file)
@@ -430,7 +430,7 @@ void CtrlTree::handleEvent( EvtGeneric &rEvent )
                     }
                 }
             }
-            else if( key == KEY_ENTER || key == KEY_SPACE )
+            else if( key == KEY_ENTER || key == ' ' )
             {
                 // Go up one level (and close node)
                 if( &*it == m_pLastSelected )
index e349a81ecb96897be698666aa2a9234e0557afd8..557565c6ef8644c0b6bcfa149548aa6168460a61 100644 (file)
@@ -60,7 +60,7 @@ Win32Loop::Win32Loop( intf_thread_t *pIntf ): OSLoop( pIntf )
     virtKeyToVlcKey[VK_F11] = KEY_F11;
     virtKeyToVlcKey[VK_F12] = KEY_F12;
     virtKeyToVlcKey[VK_RETURN] = KEY_ENTER;
-    virtKeyToVlcKey[VK_SPACE] = KEY_SPACE;
+    virtKeyToVlcKey[VK_SPACE] = ' ';
     virtKeyToVlcKey[VK_ESCAPE] = KEY_ESC;
     virtKeyToVlcKey[VK_LEFT] = KEY_LEFT;
     virtKeyToVlcKey[VK_RIGHT] = KEY_RIGHT;
index 269fba698666223a1cdc09c732d6c69b797089d9..4e11ce989d1b22d50c1fe798bec3f276cb6c252a 100644 (file)
@@ -67,7 +67,6 @@ X11Loop::X11Loop( intf_thread_t *pIntf, X11Display &rDisplay ):
     keysymToVlcKey[XK_F11] = KEY_F11;
     keysymToVlcKey[XK_F12] = KEY_F12;
     keysymToVlcKey[XK_Return] = KEY_ENTER;
-    keysymToVlcKey[XK_space] = KEY_SPACE;
     keysymToVlcKey[XK_Escape] = KEY_ESC;
     keysymToVlcKey[XK_Left] = KEY_LEFT;
     keysymToVlcKey[XK_Right] = KEY_RIGHT;
index 705b3c424458bba38649b872baa4888e67da3ad7..528f528d860e9a765072f82ab37273af0255ff61 100644 (file)
@@ -306,9 +306,6 @@ static void Manage(vout_display_t *vd)
         case AA_ESC:
             vout_display_SendEventKey(vd, KEY_ESC);
             break;
-        case 0x20:
-                vout_display_SendEventKey(vd, KEY_SPACE);
-                break;
         default:
             if (event >= 0x20 && event <= 0x7f)
                 vout_display_SendEventKey(vd, event);
index 965b14ef7c9f47325f8e2ab5039358a6a6488b5a..57f9b40eb722e323e60fc3f5cf9cba0690b652d5 100644 (file)
@@ -436,8 +436,6 @@ static const struct {
     { CACA_KEY_PAGEUP,  KEY_PAGEUP },
     { CACA_KEY_PAGEDOWN,KEY_PAGEDOWN },
 
-    { ' ',              KEY_SPACE },
-
     /* */
     { -1, -1 }
 };
index 44867abbae6e608f8acc1b0626602c2b5b1cd9e0..b34a925506ec642b4a7e0f18c29b5717ee0de443 100644 (file)
@@ -861,7 +861,7 @@ static struct
     { VK_F12, KEY_F12 },
 
     { VK_RETURN, KEY_ENTER },
-    { VK_SPACE, KEY_SPACE },
+    { VK_SPACE, ' ' },
     { VK_ESCAPE, KEY_ESC },
 
     { VK_LEFT, KEY_LEFT },
index d110c1b098ffe90b365a17c5265b7c383e958ce3..e769042dc6e0fc3f0acdcb1e900d4de355625ef9 100644 (file)
@@ -684,7 +684,7 @@ static const struct {
 
     { SDLK_RETURN, KEY_ENTER },
     { SDLK_KP_ENTER, KEY_ENTER },
-    { SDLK_SPACE, KEY_SPACE },
+    { SDLK_SPACE, ' ' },
     { SDLK_ESCAPE, KEY_ESC },
 
     { SDLK_MENU, KEY_MENU },
index e57fd244e1f67a8ff5f2bddd4356b03e89dc836c..1a976b6ebe40ddf0c263728049743383676277a9 100644 (file)
@@ -105,7 +105,7 @@ static int ConvertKeySym (xcb_keysym_t sym)
         { XK_Begin,         KEY_HOME, },
         { XK_Insert,        KEY_INSERT, },
         { XK_Menu,          KEY_MENU },
-        { XK_KP_Space,      KEY_SPACE, },
+        { XK_KP_Space,      ' ', },
         { XK_KP_Tab,        KEY_TAB, },
         { XK_KP_Enter,      KEY_ENTER, },
         { XK_KP_F1,         KEY_F1, },
@@ -156,10 +156,7 @@ static int ConvertKeySym (xcb_keysym_t sym)
         { XF86XK_Reload,           KEY_BROWSER_REFRESH, },
     };
 
-    /* X11 and VLC both use the ASCII code for printable ASCII characters,
-     * except for space (only X11). */
-    if (sym == XK_space)
-        return KEY_SPACE;
+    /* X11 and VLC both use the ASCII code for printable ASCII characters. */
     if (isascii(sym))
         return sym;
 
index a85b29f579fb70197c5bde73acbd4198ecb7387f..6945e00fd1aee411337cae63933032b8f31507a4 100644 (file)
@@ -2298,7 +2298,7 @@ vlc_module_begin ()
      */
 #   define KEY_TOGGLE_FULLSCREEN  'f'
 #   define KEY_LEAVE_FULLSCREEN   KEY_ESC
-#   define KEY_PLAY_PAUSE         KEY_SPACE
+#   define KEY_PLAY_PAUSE         ' '
 #   define KEY_PAUSE              KEY_UNSET
 #   define KEY_PLAY               KEY_UNSET
 #   define KEY_FASTER             '+'