Input device event monitor and query tool for devices that support MinUI
- A minui union toolchain
- Docker (this folder is assumed to be the contents of the toolchain workspace directory)
make
- todo: this is built inside-out. Ideally you can clone this into the MinUI workspace directory and build from there under each toolchain, but instead it gets cloned into a toolchain workspace directory and built from there.
Important
LD_LIBRARY_PATH
must be set to the MinUI toolchain's lib directory, as it is in the launch.sh
file of the MainUI.pak
.
minui-btntest <mode> <state> <combination> [<button,>...]
capture
- capture events from the input devicewait
- wait for events from the input device
just_pressed
- the button was just pressedis_pressed
- the button is currently pressedjust_released
- the button was just releasedjust_repeated
- the button was just repeated
all
- all of the buttons specifiedany
- any button that exists will match (no need to specify)either
- any of the buttons specified
btn_a
- the A buttonbtn_b
- the B buttonbtn_x
- the X buttonbtn_y
- the Y buttonbtn_l1
- the L1 buttonbtn_l2
- the L2 buttonbtn_l3
- the L3 buttonbtn_r1
- the R1 buttonbtn_r2
- the R2 buttonbtn_r3
- the R3 buttonbtn_menu
- the Menu buttonbtn_minus
- the Minus buttonbtn_plus
- the Plus buttonbtn_power
- the Power buttonbtn_poweroff
- the Power Off buttonbtn_select
- the Select buttonbtn_start
- the Start buttonbtn_up
- the Up buttonbtn_down
- the Down buttonbtn_left
- the Left buttonbtn_right
- the Right buttonbtn_dpad_up
- the D-Pad Up buttonbtn_dpad_down
- the D-Pad Down buttonbtn_dpad_left
- the D-Pad Left buttonbtn_dpad_right
- the D-Pad Right buttonbtn_analog_up
- the Analog Stick Up buttonbtn_analog_down
- the Analog Stick Down buttonbtn_analog_left
- the Analog Stick Left buttonbtn_analog_right
- the Analog Stick Right buttonbtn_none
- the None button
In the case where you want to check the current input, you can use the capture
mode. This will exit 0 if the current input matches what was specified, and 1 otherwise.
# will check to see if both A and B are pressed
minui-btntest capture just_pressed all btn_a,btn_b
# will check to see if any button is pressed
minui-btntest capture just_pressed any
# will check to see if either A or B is pressed
minui-btntest capture just_pressed either btn_a,btn_b
In the case where you want to wait for an input, you can use the wait
mode. This will exit 0 if the input matches what was specified, and 1 otherwise.
# will wait for both A and B to be pressed
minui-btntest wait just_pressed all btn_a,btn_b
# will wait for any button to be pressed
minui-btntest wait just_pressed any
# will wait for either A or B to be pressed
minui-btntest wait just_pressed either btn_a,btn_b
In some cases, the minui-btntest
command will write output to stderr. This is due to linking against the MinUI library for startup/teardown functionality, which may log errors to stderr. To suppress this output, you can redirect stderr to stdout.
minui-btntest capture just_pressed all btn_a,btn_b 2>&1 > /dev/null