@@ -310,6 +310,7 @@ void apple_input_keyboard_event(bool down,
310310 settings_t *settings = config_get_ptr ();
311311 bool keyboard_gamepad_enable = settings->bools .input_keyboard_gamepad_enable ;
312312 bool small_keyboard_enable = settings->bools .input_small_keyboard_enable ;
313+ unsigned original_code = code;
313314
314315 if (keyboard_gamepad_enable)
315316 {
@@ -326,10 +327,15 @@ void apple_input_keyboard_event(bool down,
326327 character = 0 ;
327328 }
328329
330+ /* Update state for both original and translated keys if different */
331+ if (original_code > 0 && original_code < MAX_KEYS)
332+ apple_key_state[original_code] = down;
333+
329334 if (code == 0 || code >= MAX_KEYS)
330335 return ;
331336
332- apple_key_state[code] = down;
337+ if (code != original_code)
338+ apple_key_state[code] = down;
333339
334340 input_keyboard_event (down,
335341 input_keymaps_translate_keysym_to_rk (code),
@@ -441,7 +447,7 @@ static int16_t cocoa_lightgun_aiming_state(
441447 int16_t res_y = 0 ;
442448 int16_t res_screen_x = 0 ;
443449 int16_t res_screen_y = 0 ;
444-
450+
445451 int16_t x = apple->window_pos_x ;
446452 int16_t y = apple->window_pos_y ;
447453
@@ -679,7 +685,7 @@ static int16_t cocoa_input_state(
679685 float axis_threshold = joypad_info->axis_threshold ;
680686 const uint32_t joykey = (bind_joykey != NO_BTN) ? bind_joykey : autobind_joykey;
681687 const uint32_t joyaxis = (bind_joyaxis != AXIS_NONE) ? bind_joyaxis : autobind_joyaxis;
682-
688+
683689 if (binds[port][new_id].valid )
684690 {
685691 if ((uint16_t )joykey != NO_BTN && joypad->button (joyport, (uint16_t )joykey))
0 commit comments