]> git.sesse.net Git - vlc/commitdiff
* shortcut handling under linux
authorCyril Deguet <asmax@videolan.org>
Mon, 21 Apr 2003 01:47:42 +0000 (01:47 +0000)
committerCyril Deguet <asmax@videolan.org>
Mon, 21 Apr 2003 01:47:42 +0000 (01:47 +0000)
defconfig
modules/gui/skins/gtk2/gtk2_run.cpp

index ebd71ddbaf8bd2c6f355644151b3b413f67e59e0..10026734d681a98afa975dd29f73fed97066c766 100644 (file)
--- a/defconfig
+++ b/defconfig
@@ -69,7 +69,7 @@ CONFIG_FFMPEG_TREE="/home/cyril/ffmpeg"
 # CONFIG_XVID is not set
 # CONFIG_DV is not set
 # CONFIG_FLAC is not set
-# CONFIG_LIBMPEG2 is not set
+CONFIG_LIBMPEG2=y
 CONFIG_VORBIS=y
 # CONFIG_TREMOR is not set
 # CONFIG_TARKIN is not set
index d32478e5c62d2c2e75db7d5e79d7a03cdebb50fd..dda5dde94289041f880dff87818952a6ffabcd26 100644 (file)
@@ -2,7 +2,7 @@
  * gtk2_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: gtk2_run.cpp,v 1.15 2003/04/21 00:54:26 ipkiss Exp $
+ * $Id: gtk2_run.cpp,v 1.16 2003/04/21 01:47:42 asmax Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -121,8 +121,32 @@ void GTK2Proc( GdkEvent *event, gpointer data )
             ((GdkEventAny *)event)->window, msg, 0, (long)event );
     }
 
+    // Process keyboard shortcuts
+    if( msg == GDK_KEY_PRESS )
+    {
+        int KeyModifier = 0;
+        // If key is ALT
+        if( ((GdkEventKey *)event)->state & GDK_MOD1_MASK )
+        {
+            KeyModifier = 1;
+        }
+        // If key is CTRL
+        else if( ((GdkEventKey *)event)->state & GDK_CONTROL_MASK )
+        {
+            KeyModifier = 2;
+        }
+        int key = ((GdkEventKey *)event)->keyval;
+        // Translate into lower case
+        if( key >= 'a' && key <= 'z' )
+        {
+            key -= ('a' - 'A');
+        }
+        if( KeyModifier > 0 )
+            p_intf->p_sys->p_theme->EvtBank->TestShortcut( key , KeyModifier );
+    }
+
     // Send event
-    if( IsVLCEvent( msg ) )
+    else if( IsVLCEvent( msg ) )
     {
         if( !proc->EventProc( evt ) )
         {