我买了一个Steam控制器,现在需要在Ubuntu上让它工作,怎么做呢?
创建udev文件:
sudoedit /lib/udev/rules.d/99-steam-controller-perms.rules
# This rule is needed for basic functionality of the controller in
# Steam and keyboard/mouse emulation
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
# This rule is necessary for gamepad emulation; make sure you
# replace 'pgriffais' with the username of the user that runs Steam
KERNEL=="uinput", MODE="0660", GROUP="pgriffais", OPTIONS+="static_node=uinput"
/dev/uinput
sudo chmod 666 /dev/uinput
sudo apt-get install python3-autopilot
然后注销/重新登录或者重启。这将把您添加到一个具有对/dev/uinput
写入权限的组中。这将添加一些您可能不需要的软件包,但是一旦steam软件包更新到位,您可以将它们删除。编辑udev文件:
sudoedit /lib/udev/rules.d/99-steam-controller-perms.rules
将其中的所有内容替换为:
# This rule is needed for basic functionality of the controller in Steam and keyboard/mouse emulation
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
# This rule is necessary for gamepad emulation; make sure you replace 'pgriffais' with a group that the user that runs Steam belongs to
KERNEL=="uinput", MODE="0660", GROUP="pgriffais", OPTIONS+="static_node=uinput"
# Valve HID devices over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="28de", MODE="0666"
# Valve HID devices over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*28DE:*", MODE="0666"
# DualShock 4 over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"
# DualShock 4 wireless adapter over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666"
# DualShock 4 Slim over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666"
# DualShock 4 over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666"
# DualShock 4 Slim over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="0666"
由于控制器无法直接使用,解决方案很简单:
sudo apt install steam-devices
ATTRS{idVendor}
重复了一次。第二个应该是idProduct
。# Steam Controller device node write access, per lp:1498655
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idVendor}=="1102", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idVendor}=="1142", MODE="0666"
# Steam Controller udev write access, per lp:1498658
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess"
# Steam Controller device node write access, per lp:1498655
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1102", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1142", MODE="0666"
# Steam Controller udev write access, per lp:1498658
KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess"
/lib/udev/rules.d/99-steam-perms.rules
现在请看下面 ;) - Oliusers
,它将覆盖系统上的所有用户账户。这样,如果你的安装使用不同的账户,你就不必不断修改文件了。lsusb
,发现了以下内容:Bus 001 Device 011: ID 28de:1042
/lib/udev/rules.d/99-steam-perms.rules
中添加了以下行(在其他类似行的下方):SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", ATTRS{idProduct}=="1042", MODE="0666"
/etc/udev/rules.d
文件夹中的一个文件中。sudoedit /etc/udev/rules.d/99-steam-controller-perms.rules
然后从this answer中粘贴。# This rule is needed for basic functionality of the controller in Steam and keyboard/mouse emulation
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
KERNEL=="uinput", MODE="0660", GROUP="users", OPTIONS+="static_node=uinput"
# Valve HID devices over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="28de", MODE="0666"
# Valve HID devices over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*28DE:*", MODE="0666"
# DualShock 4 over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="0666"
# DualShock 4 wireless adapter over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="0666"
# DualShock 4 Slim over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="0666"
# DualShock 4 over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="0666"
# DualShock 4 Slim over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="0666"
99-steam-controller-perms.rules
。
.rules
文件。然而,第二行(KERNEL=="uinput", MODE=
...)没有包含在内。这是否意味着如果我想要游戏手柄仿真,我还需要添加这一行呢?或者它会自动添加进去? - Joschua