From kde-core-devel Sat Jun 30 14:33:15 2001 From: Ellis Whitehead Date: Sat, 30 Jun 2001 14:33:15 +0000 To: kde-core-devel Subject: PATCH: Print key as global shortcut X-MARC-Message: https://marc.info/?l=kde-core-devel&m=99391157020819 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;