Skip to content

Commit 82f865d

Browse files
authored
Merge pull request #62 from chrisws/0_12_10
SDL: fix ALT key handling
2 parents b7d6603 + 1ba594c commit 82f865d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/platform/sdl/runtime.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,11 @@ void Runtime::handleKeyEvent(MAEvent &event) {
417417

418418
// handle ALT/SHIFT/CTRL states
419419
if (event.key != -1) {
420-
if ((event.nativeKey & KMOD_CTRL) &&
420+
if ((event.nativeKey & KMOD_ALT) &&
421+
(event.key == SDLK_LALT || event.key == SDLK_RALT)) {
422+
// ignore ALT press without modifier key
423+
event.key = -1;
424+
} else if ((event.nativeKey & KMOD_CTRL) &&
421425
(event.nativeKey & KMOD_ALT)) {
422426
event.key = SB_KEY_CTRL_ALT(event.key);
423427
} else if ((event.nativeKey & KMOD_CTRL) &&

0 commit comments

Comments
 (0)