Linux command
jstest 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Test joystick
jstest [/dev/input/js0]
Test in one-line mode
jstest --normal [/dev/input/js0]
Test using event
jstest --event [/dev/input/js0]
Test in non-blocking
jstest --nonblock [/dev/input/js0]
说明
jstest can be used to test all the features of the Linux joystick API, including non-blocking and select(2) access, as well as version 0.x compatibility mode. It reads input from Linux joystick devices (/dev/input/js*) and shows axis and button values as they change. The tool is useful for verifying joystick functionality, calibration, and troubleshooting input issues. It works with gamepads, flight sticks, and other game controllers.
参数
- --normal
- One-line mode showing immediate axis and button status.
- --old
- Same as --normal but using the 0.x compatibility interface.
- --event
- Print events as they come in.
- --nonblock
- Same as --event but in non-blocking mode.
- --select
- Same as --event but using select(2) system call.
FAQ
What is the jstest command used for?
jstest can be used to test all the features of the Linux joystick API, including non-blocking and select(2) access, as well as version 0.x compatibility mode. It reads input from Linux joystick devices (/dev/input/js*) and shows axis and button values as they change. The tool is useful for verifying joystick functionality, calibration, and troubleshooting input issues. It works with gamepads, flight sticks, and other game controllers.
How do I run a basic jstest example?
Run `jstest [/dev/input/js0]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --normal do in jstest?
One-line mode showing immediate axis and button status.