liveBook · Manning

Jstest

As explained in Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi

A Linux command-line utility that displays joystick devices, controls, and generated input events.

jstest is a Linux command-line utility for viewing joystick devices and their live input events. It reports detected axes, buttons, current values, and button states, making controller behavior observable before connecting it to robot software. section 7.5.1

Use the output to identify controller inputs:

  • Map numbered buttons to physical controls by pressing each button and observing its on/off state. section 7.5.1
  • Read axes as numeric values, with a centered stick reported as 0 and movement changing the value. section 7.5.1
  • Use the discovered numbers later to map controller inputs to application behavior. section 7.5.1

Inspect a wireless controller

Install the joystick utility, then run jstest against /dev/input/js0. The live display identifies eight axes and thirteen buttons; pressing the cross button changes button 0 to on, while pressing the circle button changes button 1 to on.

How Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi covers it

How deep it goes
Explains device discovery, live button and axis output, and event fields without implementing application-level input handling.
Examples
Demonstrates device listing, package installation, live output, PlayStation button mappings, and changing axis values.
What it assumes
Assumes a connected joystick and basic Linux terminal use while establishing device-file discovery and input inspection.
What you can do after
Diagnose controller visibility and map physical buttons and stick movements to numeric joystick inputs.
How it connects
Connects Linux input subsystem, device files, joystick axes, buttons, and input events.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi. The section links point to the parts of the book it draws on.