Fixing issue where keyUp events aren't sent for keys that become modified by the command key
This commit is contained in:
parent
cba2574e8a
commit
e33bdffc7d
|
@ -216,9 +216,11 @@ map_loose_match(Input_Modifier_Set *binding_mod_set, Input_Modifier_Set *event_m
|
||||||
i32 binding_mod_count = binding_mod_set->count;
|
i32 binding_mod_count = binding_mod_set->count;
|
||||||
Key_Code *binding_mods = binding_mod_set->mods;
|
Key_Code *binding_mods = binding_mod_set->mods;
|
||||||
for (i32 i = 0; i < binding_mod_count; i += 1){
|
for (i32 i = 0; i < binding_mod_count; i += 1){
|
||||||
if (has_modifier(event_mod_set, binding_mods[i])){
|
if (!has_modifier(event_mod_set, binding_mods[i])){
|
||||||
result += 1;
|
result = 0;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
result += 1;
|
||||||
}
|
}
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -348,7 +348,7 @@ os_popup_error(char *title, char *message){
|
||||||
#if defined(FRED_INTERNAL)
|
#if defined(FRED_INTERNAL)
|
||||||
function inline void
|
function inline void
|
||||||
mac_profile(char *name, u64 begin, u64 end){
|
mac_profile(char *name, u64 begin, u64 end){
|
||||||
printf("%s Time: %fs\n", name, ((end - begin) / 1000000.0f));
|
//printf("%s Time: %fs\n", name, ((end - begin) / 1000000.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MacProfileScope(name) for (u64 glue(_i_, __LINE__) = 0, glue(_begin_, __LINE__) = system_now_time();\
|
#define MacProfileScope(name) for (u64 glue(_i_, __LINE__) = 0, glue(_begin_, __LINE__) = system_now_time();\
|
||||||
|
@ -909,7 +909,7 @@ mac_toggle_fullscreen(void){
|
||||||
|
|
||||||
mac_profile("Frame", prev_timer_start, mac_vars.timer_start);
|
mac_profile("Frame", prev_timer_start, mac_vars.timer_start);
|
||||||
#if FRED_INTERNAL
|
#if FRED_INTERNAL
|
||||||
printf("\n");
|
//printf("\n");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1211,6 +1211,12 @@ Input_Event *event = push_input_event(&mac_vars.frame_arena, &mac_vars.input_chu
|
||||||
mac_vars.active_text_input = 0;
|
mac_vars.active_text_input = 0;
|
||||||
|
|
||||||
if (key != 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);
|
Input_Event *event = push_input_event(&mac_vars.frame_arena, &mac_vars.input_chunk.trans.event_list);
|
||||||
event->kind = InputEventKind_KeyRelease;
|
event->kind = InputEventKind_KeyRelease;
|
||||||
event->key.code = key;
|
event->key.code = key;
|
||||||
|
|
|
@ -16,7 +16,7 @@ struct Mac_Metal{
|
||||||
function
|
function
|
||||||
mac_render_sig(mac_metal__render){
|
mac_render_sig(mac_metal__render){
|
||||||
#if defined(FRED_INTERNAL)
|
#if defined(FRED_INTERNAL)
|
||||||
printf("Redering using Metal!\n");
|
//printf("Redering using Metal!\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Mac_Metal *metal = (Mac_Metal*)renderer;
|
Mac_Metal *metal = (Mac_Metal*)renderer;
|
||||||
|
|
Loading…
Reference in New Issue