From 6d2e303633b454e3877dc0a00ea8c364944f84ae Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Mon, 10 Jun 2013 15:36:21 +0200 Subject: [PATCH] [ground_segment] add joystick hat to input2ivy You can use the Hat() function to trigger events, where is one of Centered/Up/Right/Down/Left/RightUp/RightDown/LeftUp/LeftDown Only one hat can be used, but the interface will allow multiple ones in the future. closes #460 --- conf/joystick/ms_sidewinder.xml | 22 ++++--- conf/joystick/xbox_gamepad.xml | 67 +++++++++++++++++++++ sw/ground_segment/joystick/input2ivy.ml | 72 ++++++++++++++--------- sw/ground_segment/joystick/ml_sdl_stick.c | 11 ++-- sw/ground_segment/joystick/sdl_stick.c | 49 ++++++++++----- sw/ground_segment/joystick/sdl_stick.h | 1 + 6 files changed, 166 insertions(+), 56 deletions(-) create mode 100644 conf/joystick/xbox_gamepad.xml diff --git a/conf/joystick/ms_sidewinder.xml b/conf/joystick/ms_sidewinder.xml index 29c61b7734..04ac84f305 100644 --- a/conf/joystick/ms_sidewinder.xml +++ b/conf/joystick/ms_sidewinder.xml @@ -4,8 +4,6 @@ axis 1: pitch axis 2: yaw axis 3: throttle (reversed) - axis 4: hat switch left/right (right is positive) - axis 5: hat switch up/down (down is positive) It has 9 buttons. b0 - fire @@ -18,6 +16,11 @@ It has 9 buttons. b7 - button D b8 - shift button +and a POV hat. +You can use the Hat() function to trigger events, +where is one of +Centered/Up/Right/Down/Left/RightUp/RightDown/LeftUp/LeftDown +so e.g. HatDown(myhat) --> @@ -26,8 +29,6 @@ It has 9 buttons. - -