diff --git a/code/custom/4coder_default_bindings.cpp b/code/custom/4coder_default_bindings.cpp index 83cc6530..46a78e4c 100644 --- a/code/custom/4coder_default_bindings.cpp +++ b/code/custom/4coder_default_bindings.cpp @@ -145,6 +145,8 @@ function void bindings_cmd_search(Mapping* m, Command_Map* map) { Bind(query_replace, KeyCode_S); + Bind(query_replace_identifier, KeyCode_S, key_alt); + Bind(query_replace_selection, KeyCode_S, key_alt, KeyCode_Shift); Bind(search, KeyCode_F); Bind(list_all_locations_of_identifier, KeyCode_D); Bind(list_all_substring_locations_case_insensitive, KeyCode_D, key_alt); diff --git a/code/custom/custom_4coder.so b/code/custom/custom_4coder.so new file mode 100755 index 00000000..484771fa Binary files /dev/null and b/code/custom/custom_4coder.so differ diff --git a/code/platform_mac/mac_4ed.mm b/code/platform_mac/mac_4ed.mm index 0fdee594..320969ba 100644 --- a/code/platform_mac/mac_4ed.mm +++ b/code/platform_mac/mac_4ed.mm @@ -1173,6 +1173,7 @@ mac_toggle_fullscreen(void){ Input_Modifier_Set_Fixed *mods = &mac_vars.input_chunk.pers.modifiers; + b8 command; // NOTE(yuval): Set control modifiers { Control_Keys *controls = &mac_vars.input_chunk.pers.controls; @@ -1185,7 +1186,7 @@ mac_toggle_fullscreen(void){ } b8 shift = (controls->r_shift || controls->l_shift); - b8 command = (controls->r_command || controls->l_command); + command = (controls->r_command || controls->l_command); set_modifier(mods, KeyCode_Control, ctrl); set_modifier(mods, KeyCode_Alt, alt); @@ -1216,6 +1217,21 @@ mac_toggle_fullscreen(void){ } else { mac_vars.active_key_stroke = 0; mac_vars.active_text_input = 0; + + if (key != 0){ + // NOTE(PS): when releasing the command key, assume all keys being pressed + // are released + if (key == KeyCode_Command) { + mods->count = 0; + } + + Input_Event *event = push_input_event(&mac_vars.frame_arena, &mac_vars.input_chunk.trans.event_list); + event->kind = InputEventKind_KeyRelease; + event->key.code = key; + event->key.modifiers = copy_modifier_set(&mac_vars.frame_arena, mods); + + remove_modifier(mods, key); + } system_signal_step(0); } }