[Feature] Add left-handed mouse emulation for swapped button handling (#249)

* Adds left handed mouse mode config

* cleanup
This commit is contained in:
Sorché
2025-08-14 00:09:39 +02:00
committed by GitHub
parent dd5e608fd1
commit fbd5189521
2 changed files with 14 additions and 0 deletions

View File

@@ -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,

View File

@@ -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));
}