23 #include <tqnamespace.h>
24 #include <tqwindowdefs.h>
26 #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MACX) // Only compile this module if we're compiling for X11, mac or win32
28 #include "kkeynative.h"
29 #include "kkeyserver_x11.h"
32 #include <tqstringlist.h>
42 #include <X11/Xutil.h>
43 #include <X11/XKBlib.h>
44 #include <X11/keysymdef.h>
70 KKeyNative::~KKeyNative()
84 m_code = pEvent->xkey.keycode;
85 m_mod = pEvent->xkey.state;
86 XLookupString( (XKeyEvent*) pEvent, 0, 0, &keySym, 0 );
87 m_sym = (uint) keySym;
98 #elif !defined(Q_WS_WIN) && !defined(Q_WS_MACX)
114 if( m_sym == XK_Print && !(m_mod & Mod1Mask) &&
115 XkbKeycodeToKeysym( tqt_xdisplay(), 111, 0, 0 ) == XK_Print )
117 else if( m_sym == XK_Break || (m_sym == XK_Pause && (m_mod & ControlMask)) &&
118 XkbKeycodeToKeysym( tqt_xdisplay(), 114, 0, 0 ) == XK_Pause )
121 m_code = XKeysymToKeycode( tqt_xdisplay(), m_sym );
123 if( !m_code && m_sym )
124 kdDebug(125) <<
"Couldn't get code for sym" <<
endl;
127 if( key.modFlags() && ( ( m_sym < XK_Home || m_sym > XK_Begin ) &&
128 m_sym != XK_Insert && m_sym != XK_Delete ))
153 if( m_sym != key.m_sym )
return m_sym - key.m_sym;
154 if( m_mod != key.m_mod )
return m_mod - key.m_mod;
155 if( m_code != key.m_code )
return m_code - key.m_code;
171 return KKey( m_sym, m_mod );
175 return KKey( m_sym, modSpec );
187 return keyQt | modQt;