mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-06-08 09:29:31 +00:00
swap_opt_cmd assumes false if keycodes file used
This commit is contained in:
parent
cce0ed4c87
commit
90edd35246
|
@ -2055,19 +2055,13 @@ static bool is_hotkey_down(SDL_Keysym const & ks)
|
||||||
(cmd_down || (ks.mod & KMOD_GUI) || !(hotkey & 4));
|
(cmd_down || (ks.mod & KMOD_GUI) || !(hotkey & 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int modify_opt_cmd(int code) {
|
static bool swap_opt_cmd() {
|
||||||
static bool f, c;
|
static bool f, c;
|
||||||
if (!f) {
|
if (!f) {
|
||||||
f = true;
|
f = true;
|
||||||
c = PrefsFindBool("swap_opt_cmd");
|
c = PrefsFindBool("swap_opt_cmd");
|
||||||
}
|
}
|
||||||
if (c) {
|
return c;
|
||||||
switch (code) {
|
|
||||||
case 0x37: return 0x3a;
|
|
||||||
case 0x3a: return 0x37;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return code;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2144,8 +2138,8 @@ static int kc_decode(SDL_Keysym const & ks, bool key_down)
|
||||||
case SDLK_RCTRL: return 0x36;
|
case SDLK_RCTRL: return 0x36;
|
||||||
case SDLK_LSHIFT: return 0x38;
|
case SDLK_LSHIFT: return 0x38;
|
||||||
case SDLK_RSHIFT: return 0x38;
|
case SDLK_RSHIFT: return 0x38;
|
||||||
case SDLK_LALT: case SDLK_RALT: return 0x3a;
|
case SDLK_LALT: case SDLK_RALT: return swap_opt_cmd() ? 0x37 : 0x3a;
|
||||||
case SDLK_LGUI: case SDLK_RGUI: return 0x37;
|
case SDLK_LGUI: case SDLK_RGUI: return swap_opt_cmd() ? 0x3a : 0x37;
|
||||||
case SDLK_MENU: return 0x32;
|
case SDLK_MENU: return 0x32;
|
||||||
case SDLK_CAPSLOCK: return 0x39;
|
case SDLK_CAPSLOCK: return 0x39;
|
||||||
case SDLK_NUMLOCKCLEAR: return 0x47;
|
case SDLK_NUMLOCKCLEAR: return 0x47;
|
||||||
|
@ -2356,7 +2350,6 @@ static void handle_events(void)
|
||||||
code = event2keycode(event.key, true);
|
code = event2keycode(event.key, true);
|
||||||
if (code >= 0) {
|
if (code >= 0) {
|
||||||
if (!emul_suspended) {
|
if (!emul_suspended) {
|
||||||
code = modify_opt_cmd(code);
|
|
||||||
#ifdef __MACOSX__
|
#ifdef __MACOSX__
|
||||||
ADBKeyDown(code);
|
ADBKeyDown(code);
|
||||||
#else
|
#else
|
||||||
|
@ -2367,9 +2360,9 @@ static void handle_events(void)
|
||||||
#endif
|
#endif
|
||||||
if (code == 0x36)
|
if (code == 0x36)
|
||||||
ctrl_down = true;
|
ctrl_down = true;
|
||||||
if (code == 0x3a)
|
if (code == (swap_opt_cmd() ? 0x37 : 0x3a))
|
||||||
opt_down = true;
|
opt_down = true;
|
||||||
if (code == 0x37)
|
if (code == (swap_opt_cmd() ? 0x3a : 0x37))
|
||||||
cmd_down = true;
|
cmd_down = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -2386,7 +2379,6 @@ static void handle_events(void)
|
||||||
if (code == CODE_INVALID)
|
if (code == CODE_INVALID)
|
||||||
code = event2keycode(event.key, false);
|
code = event2keycode(event.key, false);
|
||||||
if (code >= 0) {
|
if (code >= 0) {
|
||||||
code = modify_opt_cmd(code);
|
|
||||||
#ifdef __MACOSX__
|
#ifdef __MACOSX__
|
||||||
ADBKeyUp(code);
|
ADBKeyUp(code);
|
||||||
#else
|
#else
|
||||||
|
@ -2395,9 +2387,9 @@ static void handle_events(void)
|
||||||
#endif
|
#endif
|
||||||
if (code == 0x36)
|
if (code == 0x36)
|
||||||
ctrl_down = false;
|
ctrl_down = false;
|
||||||
if (code == 0x3a)
|
if (code == (swap_opt_cmd() ? 0x37 : 0x3a))
|
||||||
opt_down = false;
|
opt_down = false;
|
||||||
if (code == 0x37)
|
if (code == (swap_opt_cmd() ? 0x3a : 0x37))
|
||||||
cmd_down = false;
|
cmd_down = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user