Results 1 to 4 of 4

Thread: Where does InputEvent( ev[i]) get caught?

  1. #1
    Join Date
    Nov 2008
    Posts
    178
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Unhappy 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!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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:
    Qt Code:
    1. Section "InputClass"
    2. Identifier "Ignore barcode reader because I am reading it directly through /dev/input/eventx"
    3. MatchProduct "Whizzo barcode reader"
    4. Option "Ignore" "yes"
    5. EndSection
    To copy to clipboard, switch view to plain text mode 

    Looks like you should be able to intercept raw XEvents by installing a QCoreApplication::setEventFilter() (or QAbstractEventDispatcher::setEventFilter())

  3. #3
    Join Date
    Nov 2008
    Posts
    178
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Where does InputEvent( ev[i]) get caught?

    Quote Originally Posted by ChrisW67 View Post
    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:
    Qt Code:
    1. Section "InputClass"
    2. Identifier "Ignore barcode reader because I am reading it directly through /dev/input/eventx"
    3. MatchProduct "Whizzo barcode reader"
    4. Option "Ignore" "yes"
    5. EndSection
    To copy to clipboard, switch view to plain text mode 

    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.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default 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.

    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.

Similar Threads

  1. signal getting caught in another event loop
    By raj_iv in forum Qt Programming
    Replies: 3
    Last Post: 29th September 2012, 19:35
  2. Replies: 6
    Last Post: 14th October 2010, 06:58
  3. Interrupt/Exception caught while compiling Qt program
    By Qt Coder in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2010, 22:08
  4. Resize caught by select()
    By mhoover in forum Qt Programming
    Replies: 3
    Last Post: 17th July 2009, 04:04
  5. keyPressEvent not being caught
    By vieraci in forum Qt Programming
    Replies: 2
    Last Post: 29th October 2007, 12:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.