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
for (int i = 0; i < n; ++i) {
struct ::input_event *data = &buffer;
bool unknown = false;
if (data->type == EV_ABS) {
if (data->code == ABS_X) {
m_x = data->value;
} else if (data->code == ABS_Y) {
m_y = data->value;
} else {
unknown = true;
}
} else if (data->type == EV_REL) {
if (data->code == REL_X) {
m_x += data->value;
} else if (data->code == REL_Y) {
m_y += data->value;
} else {
unknown = true;
}
} else if (data->type == EV_KEY && data->code == BTN_TOUCH) {
m_buttons = data->value ? Qt::LeftButton : 0;
} else if (data->type == EV_KEY) {
int button = 0;
switch (data->code) {
case BTN_LEFT: button = Qt::LeftButton; break;
case BTN_MIDDLE: button = Qt::MidButton; break;
case BTN_RIGHT: button = Qt::RightButton; break;
}
if (data->value)
m_buttons |= button;
else
m_buttons &= ~button;
} else if (data->type == EV_SYN && data->code == SYN_REPORT) {
pos = m_handler->transform(pos);
m_handler->limitToScreen(pos);
m_handler->mouseChanged(pos, m_buttons);
} else if (data->type == EV_MSC && data->code == MSC_SCAN) {
// kernel encountered an unmapped key - just ignore it
continue;
} else {
unknown = true;
}
if (unknown) {
qWarning("unknown mouse event type=%x, code=%x, value=%x", data->type, data->code, data->value);
}
}
for (int i = 0; i < n; ++i) {
struct ::input_event *data = &buffer;
bool unknown = false;
if (data->type == EV_ABS) {
if (data->code == ABS_X) {
m_x = data->value;
} else if (data->code == ABS_Y) {
m_y = data->value;
} else {
unknown = true;
}
} else if (data->type == EV_REL) {
if (data->code == REL_X) {
m_x += data->value;
} else if (data->code == REL_Y) {
m_y += data->value;
} else {
unknown = true;
}
} else if (data->type == EV_KEY && data->code == BTN_TOUCH) {
m_buttons = data->value ? Qt::LeftButton : 0;
} else if (data->type == EV_KEY) {
int button = 0;
switch (data->code) {
case BTN_LEFT: button = Qt::LeftButton; break;
case BTN_MIDDLE: button = Qt::MidButton; break;
case BTN_RIGHT: button = Qt::RightButton; break;
}
if (data->value)
m_buttons |= button;
else
m_buttons &= ~button;
} else if (data->type == EV_SYN && data->code == SYN_REPORT) {
QPoint pos(m_x, m_y);
pos = m_handler->transform(pos);
m_handler->limitToScreen(pos);
m_handler->mouseChanged(pos, m_buttons);
} else if (data->type == EV_MSC && data->code == MSC_SCAN) {
// kernel encountered an unmapped key - just ignore it
continue;
} else {
unknown = true;
}
if (unknown) {
qWarning("unknown mouse event type=%x, code=%x, value=%x", data->type, data->code, data->value);
}
}
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 ?
Bookmarks