; ; This example demonstrates how to hook Ano functions to input driver. ; ; For this example to work, input_driver_events_? parameter must contain ; something like this in application config (${prefix}/etc/input_driver.conf): ; ; input_driver_enable = input_usb_classic_nes_gamepad.so ; input_driver_events_1 = input_usb_classic_nes_gamepad.so:bp=drv_bp|br=drv_br|kp=drv_kp|kr=drv_kr|xy=drv_xy|xyz=drv_xyz|ad=drv_ad ; ; If program is unable to autodetect the gamepad, it must be set by hand: ; ; input_driver_params_1 = input_usb_classic_nes_gamepad.so:device=/dev/uhid1 ; ; @ANO_SCRIPT_NAME input_driver ; @ANO_SCRIPT_VERSION 0.0.2 ; @ANO_SCRIPT_DESCRIPTION Simple input driver event handler example ; ; @ANO_FLAGS_VAR_NAME_SUBS [ ] ; @ANO_FLAGS_VAR_WARN_UNUSED [ ] ; ; Copyright (c) 2016-2024, Jani Salonen ; All rights reserved. ; mov _message ("Waiting for events, press to break") dump _message end callback drv_bp (_button, _state, _pressure) { dump _button dump _state dump _pressure } callback drv_br (_button, _state) { dump _button dump _state } callback drv_kp (_button, _state, _pressure) { dump _button dump _state dump _pressure } callback drv_kr (_button, _state) { dump _button dump _state } callback drv_xy (_x, _y) { dump _x dump _y } callback drv_xyz (_x, _y, _z) { dump _x dump _y dump _z } callback drv_ad (_angle, _distance) { dump _angle dump _distance }