Where does InputEvent( ev[i]) get caught?
Been searching and searching and searching. Pulled down the source for 4.8.4 and cannot find where onInputEvent() gets caught. Cannot find it in the code even, so...either I'm missing some code or there is some hidden knowledge.
I "want" to be able to use this to obtain all of the built in character translation. I need to find where it is done though so I can stop it from generating a keyboard event when a barcode scanner actually originated the text.
I would appreciate BOTH a source file and line number to look at. It appears it "should" be caught in the X11ProcessEvent() method at line 3220 of qapplication_x11.cpp, but not really seeing this.
Thanks!
Re: Where does InputEvent( ev[i]) get caught?
If you don't want an X11 input event generated from a keyboard like device then you could tell X11 to ignore it from xorg.conf:
Code:
Section "InputClass"
Identifier "Ignore barcode reader because I am reading it directly through /dev/input/eventx"
MatchProduct "Whizzo barcode reader"
Option "Ignore" "yes"
EndSection
Looks like you should be able to intercept raw XEvents by installing a QCoreApplication::setEventFilter() (or QAbstractEventDispatcher::setEventFilter())
Re: Where does InputEvent( ev[i]) get caught?
Quote:
Originally Posted by
ChrisW67
If you don't want an X11 input event generated from a keyboard like device then you could tell X11 to ignore it from xorg.conf:
Code:
Section "InputClass"
Identifier "Ignore barcode reader because I am reading it directly through /dev/input/eventx"
MatchProduct "Whizzo barcode reader"
Option "Ignore" "yes"
EndSection
Looks like you should be able to intercept raw XEvents by installing a
QCoreApplication::setEventFilter() (or
QAbstractEventDispatcher::setEventFilter())
Thanks for your response. Was hoping to avoid xorg mod since other targets won't have xorg. Will play with event filter at core application level. Really wanted to get event _after_ translation to Unicode and _before_ it became a keypress event so I wouldn't have to recode the wheel. Will play with this today and see how it turns out.
Thanks again.
Re: Where does InputEvent( ev[i]) get caught?
You can filter cooked events using qApp->installEventFilter() but by that time you can no longer tell where the key event has come from. QApplication::x11EventFilter() might be easier for raw XEvents. I am not sure you can get the original source device this way either.
Quote:
Was hoping to avoid xorg mod since other targets won't have xorg.
I do not think you will find a universal, platform independent manner in which to do this.