[Feature] Add left-handed mouse emulation for swapped button handling (#249)
* Adds left handed mouse mode config * cleanup
This commit is contained in:
@@ -273,6 +273,9 @@ pub struct GeneralConfig {
|
||||
#[serde(default = "def_false")]
|
||||
pub focus_follows_mouse_mode: bool,
|
||||
|
||||
#[serde(default = "def_false")]
|
||||
pub left_handed_mouse: bool,
|
||||
|
||||
#[serde(default = "def_false")]
|
||||
pub block_game_input: bool,
|
||||
|
||||
|
||||
@@ -134,6 +134,17 @@ impl InteractionHandler for ScreenInteractionHandler {
|
||||
_ => MOUSE_LEFT,
|
||||
};
|
||||
|
||||
// Swap left and right buttons if left-handed mode is enabled
|
||||
let btn = if app.session.config.left_handed_mouse {
|
||||
match btn {
|
||||
MOUSE_LEFT => MOUSE_RIGHT,
|
||||
MOUSE_RIGHT => MOUSE_LEFT,
|
||||
other => other,
|
||||
}
|
||||
} else {
|
||||
btn
|
||||
};
|
||||
|
||||
if pressed {
|
||||
set_next_move(u64::from(app.session.config.click_freeze_time_ms));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user