Skip to content

Commit

Permalink
[client] wayland: support back/forward buttons on some mouses
Browse files Browse the repository at this point in the history
Despite their names, SPICE_MOUSE_BUTTON_SIDE and SPICE_MOUSE_BUTTON_EXTRA
are actually treated by Windows as BTN_BACK and BTN_FORWARD, with Edge
browser and Heroes of the Storm both recognize them and label them correctly.

Add the missing mapping for BTN_BACK and BTN_FORWARD.

This is hinted by [1].

1: rust-windowing/winit#1914 (comment)
  • Loading branch information
MakiseKurisu committed Aug 16, 2023
1 parent 219c73e commit b00b632
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/displayservers/Wayland/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ static int mapWaylandToSpiceButton(uint32_t button)
case BTN_RIGHT:
return 3; // SPICE_MOUSE_BUTTON_RIGHT
case BTN_SIDE:
case BTN_BACK:
return 6; // SPICE_MOUSE_BUTTON_SIDE
case BTN_EXTRA:
case BTN_FORWARD:
return 7; // SPICE_MOUSE_BUTTON_EXTRA
}

Expand Down

0 comments on commit b00b632

Please sign in to comment.