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.
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
.
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}
: cursorABS_{X,Y}
: scrollBTN_TR
: left clickBTN_TL
: right clickBTN_TL2
: middle click- (libinput) middle click + cursor: scroll
- keyboard
ABS_HAT0{X,Y}
+BTN_{SOUTH,EAST,NORTH,WEST,START,BASE,THUMBR}
: virtual keyboardBTN_DPAD_{UP,DOWN,LEFT,RIGHT}
: arrow keysBTN_TRIGGER_HAPPY2 + BTN_DPAD_{UP,DOWN,LEFT,RIGHT}
: pageup, pagedown, home, endBTN_SELECT
: tabBTN_START
: deleteBTN_TRIGGER_HAPPY{1,3,4,2}
: shift, ctrl, alt, altgrBTN_TR2
: superBTN_SOUTH
: enterBTN_EAST
: escBTN_NORTH
: backspaceBTN_WEST
: spaceBTN_BASE
: compose
- unused:
BTN_MODE
,BTN_THUMBL
,BTN_THUMBR
alone,BTN_THUMB2
,ABS_R{X,Y}
,ABS_HAT2{X,Y}
- pointer
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.
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.