Results 1 to 2 of 2

Thread: exporting QWS_KEYBOARD=LinuxInput:/dev/input/event0" hang application

  1. #1
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default exporting QWS_KEYBOARD=LinuxInput:/dev/input/event0" hang application

    Hi,

    I'm trying to use usb keyboard for my qt application so I plug keyboard check hexdump /dev/input/event0
    if getting events and define export QWS_KEYBOARD="LinuxInput:/dev/input/event0".
    When I run any application it hang (also qt demo). I've double check if I have linuxinput support compiled
    and it is. Any ideas what could cause such behavior?

    qt4.8.2 - details : http://www.qtcentre.org/threads/5099...en-not-working
    Thanks.

    mbe

  2. #2
    Join Date
    May 2009
    Posts
    55
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: exporting QWS_KEYBOARD=LinuxInput:/dev/input/event0" hang application

    Update: there was an issue in qkbdlinuxinput_qws.cpp.
    I just comment this part and it start working. This is just workaround
    not solution but when have time will look and post proper patch upstream.
    Cheers.

    Qt Code:
    1. if (m_tty_fd >= 0) {
    2. // save tty config for restore.
    3. tcgetattr(m_tty_fd, &m_tty_attr);
    4.  
    5. struct ::termios termdata;
    6. tcgetattr(m_tty_fd, &termdata);
    7.  
    8. // record the original mode so we can restore it again in the destructor.
    9. ::ioctl(m_tty_fd, KDGKBMODE, &m_orig_kbmode);
    10.  
    11. // setting this tranlation mode is even needed in INPUT mode to prevent
    12. // the shell from also interpreting codes, if the process has a tty
    13. // attached: e.g. Ctrl+C wouldn't copy, but kill the application.
    14. ::ioctl(m_tty_fd, KDSKBMODE, K_MEDIUMRAW);
    15.  
    16. // set the tty layer to pass-through
    17. termdata.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
    18. termdata.c_oflag = 0;
    19. termdata.c_cflag = CREAD | CS8;
    20. termdata.c_lflag = 0;
    21. termdata.c_cc[VTIME]=0;
    22. termdata.c_cc[VMIN]=1;
    23. cfsetispeed(&termdata, 9600);
    24. cfsetospeed(&termdata, 9600);
    25. tcsetattr(m_tty_fd, TCSANOW, &termdata);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 6
    Last Post: 4th December 2020, 23:11
  2. Wait for socket to connect without application hang?
    By hakermania in forum Qt Programming
    Replies: 5
    Last Post: 9th October 2011, 11:03
  3. problem in export QWS_KEYBOARD
    By BalaQT in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 26th March 2011, 12:36
  4. Replies: 3
    Last Post: 19th March 2011, 05:02
  5. "The input line is too long"
    By b1 in forum Installation and Deployment
    Replies: 1
    Last Post: 27th July 2008, 11:09

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
  •  
Qt is a trademark of The Qt Company.