disable cursor movement threshold when controller is the primary input

This commit is contained in:
thecozies 2024-04-30 08:33:58 -05:00
parent 8a70b2313e
commit eb439d6611
3 changed files with 11 additions and 0 deletions

View file

@ -114,6 +114,8 @@ namespace recomp {
};
PromptContext *get_prompt_context(void);
bool get_cont_active(void);
}
#endif

View file

@ -190,6 +190,10 @@ void recomp::set_cont_or_kb(bool cont_interacted) {
}
}
bool recomp::get_cont_active() {
return cont_active;
}
void close_config_menu_impl() {
recomp::save_config();

View file

@ -1257,6 +1257,11 @@ void draw_hook(RT64::RenderCommandList* command_list, RT64::RenderFramebuffer* s
}
last_mouse_pos[0] = cur_event.motion.x;
last_mouse_pos[1] = cur_event.motion.y;
// if controller is the primary input, don't use mouse movement to allow cursor to reactivate
if (recomp::get_cont_active()) {
break;
}
}
// fallthrough
case SDL_EventType::SDL_MOUSEBUTTONDOWN: