disable cursor movement threshold when controller is the primary input (#14)

This commit is contained in:
thecozies 2024-04-30 09:41:22 -05:00 committed by GitHub
parent 1ec20de2f5
commit 52278c5a4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

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

View File

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

View File

@ -1260,6 +1260,11 @@ void draw_hook(RT64::RenderCommandList* command_list, RT64::RenderFramebuffer* s
} }
last_mouse_pos[0] = cur_event.motion.x; last_mouse_pos[0] = cur_event.motion.x;
last_mouse_pos[1] = cur_event.motion.y; 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 // fallthrough
case SDL_EventType::SDL_MOUSEBUTTONDOWN: case SDL_EventType::SDL_MOUSEBUTTONDOWN: