mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
check the time even if the serial is the same in QKeyMapper::translateKeyEvent()
apparently X11 sends key events with same serial even seconds after (if the key is the same), also now only key presses will be considered auto-repeated because X11 sends (fake/simulated) key release events Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8055f383ae
commit
c5970df16f
1 changed files with 4 additions and 4 deletions
|
@ -222,12 +222,12 @@ bool QKeyMapper::translateKeyEvent(QWidget *keyWidget, const XEvent *event)
|
|||
static const int qt_x11_autorepeat = getX11AutoRepeat();
|
||||
static qt_auto_repeat_data curr_autorep = { 0, 0, 0, 0 };
|
||||
// modifier keys should not auto-repeat
|
||||
if (qt_x11_autorepeat && code != Qt::Key_Shift && code != Qt::Key_Control
|
||||
if (event->type == XKeyPress && qt_x11_autorepeat && code != Qt::Key_Shift && code != Qt::Key_Control
|
||||
&& code != Qt::Key_Meta && code != Qt::Key_Alt) {
|
||||
if (curr_autorep.serial == event->xkey.serial ||
|
||||
if ((curr_autorep.serial == event->xkey.serial ||
|
||||
(event->xkey.window == curr_autorep.window &&
|
||||
event->xkey.keycode == curr_autorep.keycode &&
|
||||
event->xkey.time - curr_autorep.time < qulonglong(qt_x11_autorepeat))) {
|
||||
event->xkey.keycode == curr_autorep.keycode)) &&
|
||||
event->xkey.time - curr_autorep.time < qulonglong(qt_x11_autorepeat)) {
|
||||
autorepeat = true;
|
||||
}
|
||||
curr_autorep = {
|
||||
|
|
Loading…
Add table
Reference in a new issue