![]() |
2011-06-18
, 14:18
|
|
Posts: 565 |
Thanked: 618 times |
Joined on Jun 2010
@ Finland
|
#2
|
The Following User Says Thank You to laasonen For This Useful Post: | ||
![]() |
2011-06-18
, 14:44
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#3
|
class MainWindow(QMainWindow): ... def keyReleaseEvent(self,event) if event.nativeScanCode() == 36: print 'I hit the Return key!' ...
class MyLineEdit(QLineEdit): ... def keyReleaseEvent(self,event) if event.nativeScanCode() == 36: print 'I hit the Return key!' ...
The Following User Says Thank You to daperl For This Useful Post: | ||
![]() |
2011-06-18
, 15:46
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#5
|
![]() |
2011-06-18
, 20:18
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#6
|
... #include <QDebug> #include <X11/Xlib.h> ... bool Application::x11EventFilter(XEvent *event) { XClientMessageEvent *cm = (XClientMessageEvent *) event; if (cm->type == 33 /* ClientMessage */) { qDebug() << "Application::x11EventFilter" << cm->message_type << cm->format; for (long i=0; i<5; i++) qDebug() << " " << cm->data.l[i]; } return QApplication::x11EventFilter(event); } ...
Application::x11EventFilter 464 8 65011750 24 5 0 0 Application::x11EventFilter 277 32 278 70522943 0 0 0 Application::x11EventFilter 172 32 1 600 0 0 0
Application::x11EventFilter 464 8 65011750 20 5 0 0 Application::x11EventFilter 464 8 65011750 24 5 0 0 Application::x11EventFilter 277 32 278 70559392 0 0 0 Application::x11EventFilter 172 32 1 600 0 0 0
... class EFObject(QObject): def eventFilter(s,o,e): print 'efo',o,o.focusWidget(),e,e.type() return False ... class Application(QApplication): ... app = Application(sys.argv) oic = app.inputContext() efo = EFObject() oic.installEventFilter(efo) ...
The Following 3 Users Say Thank You to daperl For This Useful Post: | ||
I'm thinking along the lines of X11/XKBlib, but I don't really know where to start with this.
'Men of high position are allowed, by a special act of grace, to accomodate their reasoning to the answer they need. Logic is only required in those of lesser rank.' - J K Galbraith
My website
GitHub