Skip to content

Commit

Permalink
Ignore key autorepeat for cursor keys as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Vogtinator committed Sep 16, 2023
1 parent 8125dce commit 7b54e65
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions qtkeypadbridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ void keyToKeypad(QKeyEvent *event)
,{Qt::Key_Return, keymap::enter}
};

// Ignore autorepeat, calc os must handle it on it's own
if (event->isAutoRepeat())
return;

// Determine virtual key that correspond to the key we got
auto vkey = event->nativeVirtualKey();

Expand Down Expand Up @@ -209,6 +205,10 @@ void keyToKeypad(QKeyEvent *event)

void QtKeypadBridge::keyPressEvent(QKeyEvent *event)
{
// Ignore autorepeat, calc os must handle it on its own
if(event->isAutoRepeat())
return;

Qt::Key key = static_cast<Qt::Key>(event->key());

switch(key)
Expand Down Expand Up @@ -244,6 +244,10 @@ void QtKeypadBridge::keyPressEvent(QKeyEvent *event)

void QtKeypadBridge::keyReleaseEvent(QKeyEvent *event)
{
// Ignore autorepeat, calc os must handle it on its own
if(event->isAutoRepeat())
return;

Qt::Key key = static_cast<Qt::Key>(event->key());

switch(key)
Expand Down

0 comments on commit 7b54e65

Please sign in to comment.