Skip to content

obsiwitch/sdmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sdmap

demo.mp4

Sdmap remaps the Steam Deck controller and provides a gamepad mode and a desktop mode without the need to launch Steam. You need a kernel with support for the controller (linux >=6.3).

SD controller -> Sdmap -> ungrab -> game
(input dev)            -> grab -> keyboard+trackpad (virtual dev) -> libinput -> wayland/xorg

Please note that since linux 6.8 the controller starts in lizard mode. Long press the start button to switch to gamepad mode to be able to use sdmap.

Install

A PKGBUILD is provided to build and install Sdmap on Arch Linux. Once installed, the sdmap.service systemd service can be enabled and started (systemctl enable --now sdmap.service). The daemon can also be tested outside the service by running sdmap-daemon.

You might also want to use sdmap during early userspace to be able to type your encryption passphrase without an external keyboard. To do so, add the sdmap hook before encrypt in the HOOKS array of /etc/mkinitcpio.conf.

Keybindings

  • BTN_THUMB: switch between gamepad and desktop mode
  • gamepad mode (ungrabbed input device)
  • desktop mode (grabbed input device & output to virtual device)
    • pointer
      • ABS_HAT1{X,Y}: cursor
      • ABS_{X,Y}: scroll
      • BTN_TR: left click
      • BTN_TL: right click
      • BTN_TL2: middle click
      • (libinput) middle click + cursor: scroll
    • keyboard
      • ABS_HAT0{X,Y} + BTN_{SOUTH,EAST,NORTH,WEST,START,BASE,THUMBR}: virtual keyboard
      • BTN_DPAD_{UP,DOWN,LEFT,RIGHT}: arrow keys
      • BTN_TRIGGER_HAPPY2 + BTN_DPAD_{UP,DOWN,LEFT,RIGHT}: pageup, pagedown, home, end
      • BTN_SELECT: tab
      • BTN_START: delete
      • BTN_TRIGGER_HAPPY{1,3,4,2}: shift, ctrl, alt, altgr
      • BTN_TR2: super
      • BTN_SOUTH: enter
      • BTN_EAST: esc
      • BTN_NORTH: backspace
      • BTN_WEST: space
      • BTN_BASE: compose
    • unused: BTN_MODE, BTN_THUMBL, BTN_THUMBR alone, BTN_THUMB2, ABS_R{X,Y}, ABS_HAT2{X,Y}

Virtual Keyboard Sticker

sticker

A sticker can be generated and printed for the virtual keyboard on the left trackpad. It's a simple solution that (initially) didn't require me to develop a GUI. I printed the sticker on photo paper and glued it on the trackpad. The controller vibrates to provide feedback when the user moves their finger between cells.

sdmap-sticker > sticker.html
chromium --headless --screenshot=sticker.png sticker.html
convert -trim -density 300 sticker.png{,} # 378px / 300ppi = 1.26in ≈ 3.2cm

You can also 3D print a frame (model, screenshot) that you can fit on top of the sticker and trackpad.

GUI

sdmap-gui desktop notification

The current iteration of sdmap-gui is a simple desktop notification sent each time the finger moves to a different cell on the left trackpad.

About

Steam Deck controller remap utility

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published