Results 1 to 2 of 2

Thread: Can usb mouse wheel work in Qt/E ?

  1. #1
    Join Date
    Dec 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Cool Can usb mouse wheel work in Qt/E ?

    I configure the mouse like this:
    export QWS_MOUSE_PROTO="LinuxInput:/dev/input/event1"

    when I move the usb mouse, the mouse work fine.
    when I scroll the mouse wheel in Qt/E application,I got the message:
    "unknown mouse event type=2, code=8, value=1"

    I look at the Qt source (version 4.7.3) code:
    qt-everywhere-opensource-src-4.7.3\src\gui\embedded\qmouselinuxinput_qws.cpp
    Qt Code:
    1. for (int i = 0; i < n; ++i) {
    2. struct ::input_event *data = &buffer;
    3.  
    4.  
    5. bool unknown = false;
    6. if (data->type == EV_ABS) {
    7. if (data->code == ABS_X) {
    8. m_x = data->value;
    9. } else if (data->code == ABS_Y) {
    10. m_y = data->value;
    11. } else {
    12. unknown = true;
    13. }
    14. } else if (data->type == EV_REL) {
    15. if (data->code == REL_X) {
    16. m_x += data->value;
    17. } else if (data->code == REL_Y) {
    18. m_y += data->value;
    19. } else {
    20. unknown = true;
    21. }
    22. } else if (data->type == EV_KEY && data->code == BTN_TOUCH) {
    23. m_buttons = data->value ? Qt::LeftButton : 0;
    24. } else if (data->type == EV_KEY) {
    25. int button = 0;
    26. switch (data->code) {
    27. case BTN_LEFT: button = Qt::LeftButton; break;
    28. case BTN_MIDDLE: button = Qt::MidButton; break;
    29. case BTN_RIGHT: button = Qt::RightButton; break;
    30. }
    31. if (data->value)
    32. m_buttons |= button;
    33. else
    34. m_buttons &= ~button;
    35. } else if (data->type == EV_SYN && data->code == SYN_REPORT) {
    36. QPoint pos(m_x, m_y);
    37. pos = m_handler->transform(pos);
    38. m_handler->limitToScreen(pos);
    39. m_handler->mouseChanged(pos, m_buttons);
    40. } else if (data->type == EV_MSC && data->code == MSC_SCAN) {
    41. // kernel encountered an unmapped key - just ignore it
    42. continue;
    43. } else {
    44. unknown = true;
    45. }
    46. if (unknown) {
    47. qWarning("unknown mouse event type=%x, code=%x, value=%x", data->type, data->code, data->value);
    48. }
    49. }
    To copy to clipboard, switch view to plain text mode 

    In the code , It seems that the Qt/E did not support the mouse wheel (when use linux input driver).

    I want to know does the Qt/E support the mouse wheel (when use linux input driver) ?
    or something wrong with my Qt configure ?

  2. #2
    Join Date
    Dec 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Can usb mouse wheel work in Qt/E ?

    anybody know about this ?

Similar Threads

  1. Scrolling on Mouse Wheel
    By penny in forum Qt Programming
    Replies: 4
    Last Post: 7th April 2011, 07:30
  2. Can't get mouse to work.
    By weaver4 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 3rd November 2010, 18:49
  3. QDial disabling key scroll and mouse wheel scroll
    By ldg20 in forum Qt Programming
    Replies: 2
    Last Post: 2nd June 2010, 23:05
  4. mouse pressevent doesnt work inside a QListWidget
    By john_god in forum Qt Programming
    Replies: 0
    Last Post: 25th February 2009, 02:32
  5. Mouse Tracking doesnt work from QCanvasView?
    By hgsw in forum Qt Programming
    Replies: 1
    Last Post: 4th January 2007, 01:59

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.