Skip to content

Commit 1d27787

Browse files
authored
Did not notice this somehow
1 parent 6a51a7b commit 1d27787

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/backend.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -482,16 +482,16 @@ static float SCROLL_SENSITIVITY = 10;
482482
// CCIMEDispatcher stuff only gets called on mobile if the virtual keyboard would be up.
483483
// Similarly, CCKeyboardDispatcher doesn't get called if the virtual keyboard would be up.
484484
#ifdef GEODE_IS_MOBILE
485-
if (down) {
485+
if (data.action != KeyboardEventData::Action::Release) {
486486
char c = 0;
487-
if (key >= KEY_A && key <= KEY_Z) {
488-
c = static_cast<char>(key);
487+
if (data.key >= KEY_A && data.key <= KEY_Z) {
488+
c = static_cast<char>(data.key);
489489
if (!io.KeyShift) {
490490
c = static_cast<char>(tolower(c));
491491
}
492-
} else if (key >= KEY_Zero && key <= KEY_Nine) {
493-
c = static_cast<char>('0' + (key - KEY_Zero));
494-
} else if (key == KEY_Space) {
492+
} else if (data.key >= KEY_Zero && data.key <= KEY_Nine) {
493+
c = static_cast<char>('0' + (data.key - KEY_Zero));
494+
} else if (data.key == KEY_Space) {
495495
c = ' ';
496496
}
497497

@@ -500,7 +500,7 @@ static float SCROLL_SENSITIVITY = 10;
500500
io.AddInputCharactersUTF8(str.c_str());
501501
}
502502
}
503-
if (key == KEY_Backspace) {
503+
if (data.key == KEY_Backspace) {
504504
io.AddKeyEvent(ImGuiKey_Backspace, true);
505505
io.AddKeyEvent(ImGuiKey_Backspace, false);
506506
}
@@ -545,4 +545,4 @@ class $modify(CCKeyboardDispatcher) {
545545
CCKeyboardDispatcher::updateModifierKeys(shft, ctrl, alt, cmd);
546546
}
547547
};
548-
#endif
548+
#endif

0 commit comments

Comments
 (0)