[GH-ISSUE #361] [Feature Request] Swap alt/meta #188

Open
opened 2026-05-05 22:13:14 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @kiwiz on GitHub (Jan 12, 2026).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/361

Specifically, I'd like to swap the alt and meta keys between a specific client/server pair. A more general key remapping feature would be interesting too, but I don't know if that would be considered in scope for this project.

Originally created by @kiwiz on GitHub (Jan 12, 2026). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/361 Specifically, I'd like to swap the alt and meta keys between a specific client/server pair. A more general key remapping feature would be interesting too, but I don't know if that would be considered in scope for this project.
gitea-mirror added the
enhancement
label 2026-05-05 22:13:14 -06:00
Author
Owner

@alex-moon commented on GitHub (Jan 19, 2026):

+1 for this - these are mysteriously swapped on my MacBook using the mouse plugged into my Fedora 43 machine (running Hyprland from the sdegler copr). The other thing that would be really useful is scroll direction swapping for the same reason. These could be toggles imho. For anyone coming to this looking for a workaround, I am using a bash script with hyprctl to do this:

#!/usr/bin/env bash

IS_LINUX=true

set_linux() {
  if [ "$IS_LINUX" = true ]; then
    return
  fi
  hyprctl keyword device[mouse-device-id]:natural_scroll false
  hyprctl keyword device[keyboard-device-id]:kb_options ""
  IS_LINUX=true
}

set_mac() {
  if [ "$IS_LINUX" = false ]; then
    return
  fi
  hyprctl keyword device[mouse-device-id]:natural_scroll true
  hyprctl keyword device[keyboard-device-id]:kb_options "altwin:swap_alt_win"
  IS_LINUX=false
}

while true; do
  CURRENT_X=$(hyprctl cursorpos | grep -o '^[0-9]\+')
  if [ "$CURRENT_X" -eq "0" ]; then
    set_mac
  else
    set_linux
  fi
  sleep 0.5
done
<!-- gh-comment-id:3769242698 --> @alex-moon commented on GitHub (Jan 19, 2026): +1 for this - these are mysteriously swapped on my MacBook using the mouse plugged into my Fedora 43 machine (running Hyprland from the sdegler copr). The other thing that would be really useful is scroll direction swapping for the same reason. These could be toggles imho. For anyone coming to this looking for a workaround, I am using a bash script with hyprctl to do this: ``` #!/usr/bin/env bash IS_LINUX=true set_linux() { if [ "$IS_LINUX" = true ]; then return fi hyprctl keyword device[mouse-device-id]:natural_scroll false hyprctl keyword device[keyboard-device-id]:kb_options "" IS_LINUX=true } set_mac() { if [ "$IS_LINUX" = false ]; then return fi hyprctl keyword device[mouse-device-id]:natural_scroll true hyprctl keyword device[keyboard-device-id]:kb_options "altwin:swap_alt_win" IS_LINUX=false } while true; do CURRENT_X=$(hyprctl cursorpos | grep -o '^[0-9]\+') if [ "$CURRENT_X" -eq "0" ]; then set_mac else set_linux fi sleep 0.5 done ```
Author
Owner

@kiwiz commented on GitHub (Feb 6, 2026):

@alex-moon see #347, which coincidentally would be a good place in the config to put this as well.

<!-- gh-comment-id:3862399011 --> @kiwiz commented on GitHub (Feb 6, 2026): @alex-moon see #347, which coincidentally would be a good place in the config to put this as well.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/lan-mouse#188
No description provided.