Skip to content

Commit

Permalink
fix caps lock
Browse files Browse the repository at this point in the history
  • Loading branch information
kanjitalk755 committed Jul 11, 2018
1 parent e760d28 commit bdd101e
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions BasiliskII/src/SDL/video_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ static const bool use_vosf = false; // VOSF not possible
static bool ctrl_down = false; // Flag: Ctrl key pressed
static bool opt_down = false; // Flag: Opt key pressed
static bool cmd_down = false; // Flag: Cmd key pressed
static bool caps_on = false; // Flag: Caps Lock on
static bool quit_full_screen = false; // Flag: DGA close requested from redraw thread
static bool emerg_quit = false; // Flag: Ctrl-Esc pressed, emergency quit requested from MacOS thread
static bool emul_suspended = false; // Flag: Emulator suspended
Expand Down Expand Up @@ -2180,15 +2179,9 @@ static void handle_events(void)
code = event2keycode(event.key, true);
if (code >= 0) {
if (!emul_suspended) {
if (code == 0x39) { // Caps Lock pressed
if (caps_on) {
ADBKeyUp(code);
caps_on = false;
} else {
ADBKeyDown(code);
caps_on = true;
}
} else
if (code == 0x39)
(SDL_GetModState() & KMOD_CAPS ? ADBKeyDown : ADBKeyUp)(code);
else
ADBKeyDown(code);
if (code == 0x36)
ctrl_down = true;
Expand Down Expand Up @@ -2219,15 +2212,7 @@ static void handle_events(void)
} else
code = event2keycode(event.key, false);
if (code >= 0) {
if (code == 0x39) { // Caps Lock released
if (caps_on) {
ADBKeyUp(code);
caps_on = false;
} else {
ADBKeyDown(code);
caps_on = true;
}
} else
if (code != 0x39)
ADBKeyUp(code);
if (code == 0x36)
ctrl_down = false;
Expand Down

0 comments on commit bdd101e

Please sign in to comment.