Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion crates/openlogi-core/src/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,16 @@ pub enum Action {
/// Mouse "forward" side button (extra button 5). Native counterpart to
/// [`Action::MouseBack`]; see [`Action::BrowserForward`] for the ⌘] form.
MouseForward,
/// Extra mouse button 6. Emitted as the real button-6 event for apps, games,
/// and CAD software that bind it. macOS/Linux only — Windows `SendInput`
/// caps at button 5, so this logs-and-skips there.
MouseButton6,
/// Extra mouse button 7. See [`Action::MouseButton6`].
MouseButton7,
/// Extra mouse button 8. See [`Action::MouseButton6`].
MouseButton8,
/// Extra mouse button 9. See [`Action::MouseButton6`].
MouseButton9,

// ── Editing ──────────────────────────────────────────────────────────────
/// Copy the current selection (⌘C / Ctrl+C).
Expand Down Expand Up @@ -684,6 +694,10 @@ impl Action {
Action::MiddleClick => "Middle Click".into(),
Action::MouseBack => "Back (Button 4)".into(),
Action::MouseForward => "Forward (Button 5)".into(),
Action::MouseButton6 => "Button 6".into(),
Action::MouseButton7 => "Button 7".into(),
Action::MouseButton8 => "Button 8".into(),
Action::MouseButton9 => "Button 9".into(),
Action::Copy => "Copy".into(),
Action::Paste => "Paste".into(),
Action::Cut => "Cut".into(),
Expand Down Expand Up @@ -734,7 +748,11 @@ impl Action {
| Action::RightClick
| Action::MiddleClick
| Action::MouseBack
| Action::MouseForward => Category::Mouse,
| Action::MouseForward
| Action::MouseButton6
| Action::MouseButton7
| Action::MouseButton8
| Action::MouseButton9 => Category::Mouse,
// CustomShortcut is assigned to Editing so it doesn't need a
// separate arm (it's not in the picker catalog).
Action::Copy
Expand Down Expand Up @@ -792,6 +810,10 @@ impl Action {
Action::MiddleClick,
Action::MouseBack,
Action::MouseForward,
Action::MouseButton6,
Action::MouseButton7,
Action::MouseButton8,
Action::MouseButton9,
// Editing
Action::Copy,
Action::Paste,
Expand Down Expand Up @@ -1347,6 +1369,20 @@ mod tests {
assert_eq!(Action::LeftClick.category(), Category::Mouse);
assert_eq!(Action::RightClick.category(), Category::Mouse);
assert_eq!(Action::MiddleClick.category(), Category::Mouse);
assert_eq!(Action::MouseBack.category(), Category::Mouse);
assert_eq!(Action::MouseForward.category(), Category::Mouse);
assert_eq!(Action::MouseButton6.category(), Category::Mouse);
assert_eq!(Action::MouseButton7.category(), Category::Mouse);
assert_eq!(Action::MouseButton8.category(), Category::Mouse);
assert_eq!(Action::MouseButton9.category(), Category::Mouse);
}

#[test]
fn extra_mouse_button_labels() {
assert_eq!(Action::MouseButton6.label(), "Button 6");
assert_eq!(Action::MouseButton7.label(), "Button 7");
assert_eq!(Action::MouseButton8.label(), "Button 8");
assert_eq!(Action::MouseButton9.label(), "Button 9");
}

#[test]
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/da.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Midterklik"
"Back (Button 4)": "Tilbage (knap 4)"
"Forward (Button 5)": "Frem (knap 5)"
"Button 6": "knap 6"
"Button 7": "knap 7"
"Button 8": "knap 8"
"Button 9": "knap 9"
"Back": "Tilbage"
"Forward": "Frem"
"DPI Toggle": "DPI-skift"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Mittelklick"
"Back (Button 4)": "Zurück (Taste 4)"
"Forward (Button 5)": "Vor (Taste 5)"
"Button 6": "Taste 6"
"Button 7": "Taste 7"
"Button 8": "Taste 8"
"Button 9": "Taste 9"
"Back": "Zurück"
"Forward": "Vor"
"DPI Toggle": "DPI-Umschaltung"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Μεσαίο κλικ"
"Back (Button 4)": "Πίσω (κουμπί 4)"
"Forward (Button 5)": "Εμπρός (κουμπί 5)"
"Button 6": "κουμπί 6"
"Button 7": "κουμπί 7"
"Button 8": "κουμπί 8"
"Button 9": "κουμπί 9"
"Back": "Πίσω"
"Forward": "Εμπρός"
"DPI Toggle": "Εναλλαγή DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Middle Click"
"Back (Button 4)": "Back (Button 4)"
"Forward (Button 5)": "Forward (Button 5)"
"Button 6": "Button 6"
"Button 7": "Button 7"
"Button 8": "Button 8"
"Button 9": "Button 9"
"Back": "Back"
"Forward": "Forward"
"DPI Toggle": "DPI Toggle"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Clic central"
"Back (Button 4)": "Atrás (botón 4)"
"Forward (Button 5)": "Adelante (botón 5)"
"Button 6": "botón 6"
"Button 7": "botón 7"
"Button 8": "botón 8"
"Button 9": "botón 9"
"Back": "Atrás"
"Forward": "Adelante"
"DPI Toggle": "Cambiar DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Keskinapsautus"
"Back (Button 4)": "Takaisin (painike 4)"
"Forward (Button 5)": "Eteenpäin (painike 5)"
"Button 6": "painike 6"
"Button 7": "painike 7"
"Button 8": "painike 8"
"Button 9": "painike 9"
"Back": "Takaisin"
"Forward": "Eteenpäin"
"DPI Toggle": "DPI-vaihto"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Clic du milieu"
"Back (Button 4)": "Précédent (bouton 4)"
"Forward (Button 5)": "Suivant (bouton 5)"
"Button 6": "bouton 6"
"Button 7": "bouton 7"
"Button 8": "bouton 8"
"Button 9": "bouton 9"
"Back": "Précédent"
"Forward": "Suivant"
"DPI Toggle": "Bascule DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Click centrale"
"Back (Button 4)": "Indietro (pulsante 4)"
"Forward (Button 5)": "Avanti (pulsante 5)"
"Button 6": "pulsante 6"
"Button 7": "pulsante 7"
"Button 8": "pulsante 8"
"Button 9": "pulsante 9"
"Back": "Indietro"
"Forward": "Avanti"
"DPI Toggle": "Cambia DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "中クリック"
"Back (Button 4)": "戻る(サイドボタン4)"
"Forward (Button 5)": "進む(サイドボタン5)"
"Button 6": "ボタン6"
"Button 7": "ボタン7"
"Button 8": "ボタン8"
"Button 9": "ボタン9"
"Back": "戻る"
"Forward": "進む"
"DPI Toggle": "DPI 切り替え"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "가운데 클릭"
"Back (Button 4)": "뒤로 (버튼 4)"
"Forward (Button 5)": "앞으로 (버튼 5)"
"Button 6": "버튼 6"
"Button 7": "버튼 7"
"Button 8": "버튼 8"
"Button 9": "버튼 9"
"Back": "뒤로"
"Forward": "앞으로"
"DPI Toggle": "DPI 전환"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/nb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Midtklikk"
"Back (Button 4)": "Tilbake (knapp 4)"
"Forward (Button 5)": "Frem (knapp 5)"
"Button 6": "knapp 6"
"Button 7": "knapp 7"
"Button 8": "knapp 8"
"Button 9": "knapp 9"
"Back": "Tilbake"
"Forward": "Frem"
"DPI Toggle": "DPI-veksling"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Middenklik"
"Back (Button 4)": "Vorige (knop 4)"
"Forward (Button 5)": "Volgende (knop 5)"
"Button 6": "knop 6"
"Button 7": "knop 7"
"Button 8": "knop 8"
"Button 9": "knop 9"
"Back": "Vorige"
"Forward": "Volgende"
"DPI Toggle": "DPI wisselen"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Środkowy przycisk"
"Back (Button 4)": "Wstecz (przycisk 4)"
"Forward (Button 5)": "Do przodu (przycisk 5)"
"Button 6": "przycisk 6"
"Button 7": "przycisk 7"
"Button 8": "przycisk 8"
"Button 9": "przycisk 9"
"Back": "Wstecz"
"Forward": "Do przodu"
"DPI Toggle": "Przełącznik DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/pt-BR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Clique do Meio"
"Back (Button 4)": "Voltar (botão 4)"
"Forward (Button 5)": "Avançar (botão 5)"
"Button 6": "botão 6"
"Button 7": "botão 7"
"Button 8": "botão 8"
"Button 9": "botão 9"
"Back": "Voltar"
"Forward": "Avançar"
"DPI Toggle": "Alternar DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/pt-PT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Clique central"
"Back (Button 4)": "Retroceder (botão 4)"
"Forward (Button 5)": "Avançar (botão 5)"
"Button 6": "botão 6"
"Button 7": "botão 7"
"Button 8": "botão 8"
"Button 9": "botão 9"
"Back": "Retroceder"
"Forward": "Avançar"
"DPI Toggle": "Alternar DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Средний щелчок"
"Back (Button 4)": "Назад (боковая кнопка 4)"
"Forward (Button 5)": "Вперёд (боковая кнопка 5)"
"Button 6": "кнопка 6"
"Button 7": "кнопка 7"
"Button 8": "кнопка 8"
"Button 9": "кнопка 9"
"Back": "Назад"
"Forward": "Вперёд"
"DPI Toggle": "Переключение DPI"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/sv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "Mittenklick"
"Back (Button 4)": "Bakåt (knapp 4)"
"Forward (Button 5)": "Framåt (knapp 5)"
"Button 6": "knapp 6"
"Button 7": "knapp 7"
"Button 8": "knapp 8"
"Button 9": "knapp 9"
"Back": "Bakåt"
"Forward": "Framåt"
"DPI Toggle": "DPI-växling"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "中键单击"
"Back (Button 4)": "后退(侧键4)"
"Forward (Button 5)": "前进(侧键5)"
"Button 6": "键6"
"Button 7": "键7"
"Button 8": "键8"
"Button 9": "键9"
"Back": "后退"
"Forward": "前进"
"DPI Toggle": "灵敏度切换"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/zh-HK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "中鍵單擊"
"Back (Button 4)": "後退(側鍵4)"
"Forward (Button 5)": "前進(側鍵5)"
"Button 6": "鍵6"
"Button 7": "鍵7"
"Button 8": "鍵8"
"Button 9": "鍵9"
"Back": "後退"
"Forward": "前進"
"DPI Toggle": "靈敏度切換"
Expand Down
4 changes: 4 additions & 0 deletions crates/openlogi-gui/locales/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ _version: 1
"Middle Click": "中鍵按一下"
"Back (Button 4)": "後退(側鍵4)"
"Forward (Button 5)": "前進(側鍵5)"
"Button 6": "鍵6"
"Button 7": "鍵7"
"Button 8": "鍵8"
"Button 9": "鍵9"
"Back": "後退"
"Forward": "前進"
"DPI Toggle": "靈敏度切換"
Expand Down
6 changes: 6 additions & 0 deletions crates/openlogi-gui/src/mouse_model/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ pub(crate) fn action_icon_path(action: &Action) -> &'static str {
// BrowserBack/BrowserForward's bare arrows in the Navigation section.
Action::MouseBack => "action-icons/circle-arrow-left.svg",
Action::MouseForward => "action-icons/circle-arrow-right.svg",
// Buttons 6–9 have no canonical glyph; reuse the generic mouse icon
// (same as MiddleClick). The button number is in the label.
Action::MouseButton6
| Action::MouseButton7
| Action::MouseButton8
| Action::MouseButton9 => "action-icons/mouse.svg",
Action::Copy => "action-icons/copy.svg",
Action::Paste => "action-icons/clipboard-paste.svg",
Action::Cut => "action-icons/scissors.svg",
Expand Down
24 changes: 24 additions & 0 deletions crates/openlogi-inject/src/inject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ fn execute_linux(action: &Action) {
// buttons ("back"/"forward") browsers handle natively.
Action::MouseBack => linux::click(KeyCode::BTN_SIDE),
Action::MouseForward => linux::click(KeyCode::BTN_EXTRA),
// Buttons 6–9 use the evdev extra-button codes beyond the side pair.
Action::MouseButton6 => linux::click(KeyCode::BTN_FORWARD),
Action::MouseButton7 => linux::click(KeyCode::BTN_BACK),
Action::MouseButton8 => linux::click(KeyCode::BTN_TASK),
Action::MouseButton9 => linux::click(KeyCode::BTN_0),
Comment on lines +80 to +83

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Linux Events Lack Capabilities

When these actions run on Linux, linux::click emits key codes that the virtual uinput device does not advertise in its key capabilities. The existing side-button path registers its codes because the kernel silently drops unregistered events, so MouseButton6 through MouseButton9 can be selected but produce no input on Linux.

Fix in Codex Fix in Claude Code

Comment on lines +80 to +83

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Linux Button Numbers Are Reordered

The new Linux mapping mixes semantic side-button codes with the positional BTN_0 range, so the emitted events do not line up with the user-facing button numbers. A Linux app that binds the numbered extra buttons can receive BTN_FORWARD, BTN_BACK, BTN_TASK, and then BTN_0 for Button 9, which makes Button 9 look like the first generic button instead of the ninth numbered button.

Fix in Codex Fix in Claude Code

// ── Editing ───────────────────────────────────────────────────────
Action::Copy => linux::press_key(&[ctrl], KeyCode::KEY_C),
Action::Paste => linux::press_key(&[ctrl], KeyCode::KEY_V),
Expand Down Expand Up @@ -185,6 +190,13 @@ fn execute_macos(action: &Action) {
// 4 = forward / "button 5").
Action::MouseBack => macos::post_other_button(3),
Action::MouseForward => macos::post_other_button(4),
// Buttons 6–9 (button numbers 5–8, 0-indexed). Same path as 4/5 —
// post_other_button stamps MOUSE_EVENT_BUTTON_NUMBER to address any
// button ≥ 3.
Action::MouseButton6 => macos::post_other_button(5),
Action::MouseButton7 => macos::post_other_button(6),
Action::MouseButton8 => macos::post_other_button(7),
Action::MouseButton9 => macos::post_other_button(8),
// ── Editing ───────────────────────────────────────────────────────
Action::Copy => macos::post_key(VK_C, cmd),
Action::Paste => macos::post_key(VK_V, cmd),
Expand Down Expand Up @@ -289,6 +301,18 @@ fn execute_windows(action: &Action) {
Action::MiddleClick => windows::post_click(windows::MouseButton::Middle),
Action::MouseBack => windows::post_click(windows::MouseButton::Back),
Action::MouseForward => windows::post_click(windows::MouseButton::Forward),
// Windows SendInput carries flags for buttons 1–5 only; there is no
// flag for button 6+, so these log-and-skip (same pattern as the
// macOS-only navigation actions). macOS/Linux emit them natively.
Action::MouseButton6
| Action::MouseButton7
| Action::MouseButton8
| Action::MouseButton9 => {
tracing::debug!(
action = action.label(),
"mouse buttons 6-9 are not supported on Windows — press ignored"
);
}
Action::Copy => windows::post_key(windows::VK_C, &[windows::VK_CONTROL]),
Action::Paste => windows::post_key(windows::VK_V, &[windows::VK_CONTROL]),
Action::Cut => windows::post_key(windows::VK_X, &[windows::VK_CONTROL]),
Expand Down
Loading