mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp.git
synced 2025-10-30 08:03:03 +00:00
Preventing mouse inputs when game shouldn't have them
This commit is contained in:
parent
62931374c9
commit
cb268583a1
1 changed files with 10 additions and 3 deletions
|
|
@ -678,10 +678,11 @@ bool recomp::get_input_digital(const recomp::InputField& field) {
|
|||
// TODO adjustable threshold
|
||||
return controller_axis_state(field.input_id, true) >= axis_threshold;
|
||||
case InputType::Mouse:
|
||||
//std::cout << "Mouse State: " << InputState.mouse_button_state << "\n";
|
||||
return (InputState.mouse_button_state.load() & InputState.mouse_button_mask.load()) & (1 << field.input_id);
|
||||
// TODO mouse support
|
||||
if (recomp::game_input_disabled()) {
|
||||
return false;
|
||||
}
|
||||
return (InputState.mouse_button_state.load() & InputState.mouse_button_mask.load()) & (1 << field.input_id);
|
||||
|
||||
case InputType::None:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -710,10 +711,16 @@ void recomp::get_mouse_deltas(float* x, float* y) {
|
|||
}
|
||||
|
||||
int32_t recomp::get_mouse_wheel_pos() {
|
||||
if (recomp::game_input_disabled()) {
|
||||
return 0;
|
||||
}
|
||||
return InputState.mouse_wheel_pos.load();
|
||||
}
|
||||
|
||||
uint32_t recomp::get_mouse_buttons() {
|
||||
if (recomp::game_input_disabled()) {
|
||||
return 0;
|
||||
}
|
||||
return InputState.mouse_button_state.load();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue