[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    PATCH: Print key as global shortcut
From:       Ellis Whitehead <kde () ellisw ! net>
Date:       2001-06-30 14:33:15
[Download RAW message or body]

I already committed this, but upon second thought, I'm posting the patch to 
the list:

Get Print key working in global shortcuts.  I'm skeptical about this patch, 
but since everyone whose tested the Print key so far hasn't had success, this 
hack at least won't break anything that's already working for us.  For anyone 
whose X correctly defines only ONE Print key, this will have no effect.

===================================================================
RCS file: /home/kde/kdelibs/kdecore/kaccel.cpp,v
retrieving revision 1.86
diff -u -3 -d -p -r1.86 kaccel.cpp
--- kaccel.cpp	2001/06/30 13:58:02	1.86
+++ kaccel.cpp	2001/06/30 14:19:19
@@ -899,6 +899,11 @@ uint KAccel::stringToKey( const QString&
 		keySymXMods( keySymX, &keyCombQt, &keyModX );
 	}
 
+	// Hack: for some reason, X defines both keycodes 92 & 111 as being
+	//  Print.  It seems that 111 is usually the correct code.
+	if( keyCodeX == 92 && keySymX == XK_Print && XKeycodeToKeysym( 
qt_xdisplay(), 111, 0 ) == XK_Print )
+		keyCodeX = 111;
+
 	if( pKeySymX )	*pKeySymX = keySymX;
 	if( pKeyCodeX )	*pKeyCodeX = keyCodeX;
 	if( pKeyModX )	*pKeyModX = keyModX;
@@ -1083,6 +1088,11 @@ void KAccel::keyQtToKeyX( uint keyCombQt
 			}
 		}
 	}
+
+	// Hack: for some reason, X defines both keycodes 92 & 111 as being
+	//  Print.  It seems that 111 is usually the correct code.
+	if( keyCodeX == 92 && keySymX == XK_Print && XKeycodeToKeysym( 
qt_xdisplay(), 111, 0 ) == XK_Print )
+		keyCodeX = 111;
 
 	if( pKeySymX )	*pKeySymX = keySymX;
 	if( pKeyCodeX ) *pKeyCodeX = keyCodeX;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic