What I meant is that
JXInput supports high-level structures that allow e.g. to have an 'Axis' (like a joysticks x-, y- or z-axis) only by using 'Button's (e.g. from a joystick again or a keyboard. Like this one:
1 2 3 4 5 6 7 8 9 10 11 12
| JXKeyboardInputDevice kd = JXInputManager.createKeyboardDevice( comp );
Button left = kd.createButton( KeyEvent.VK_LEFT ); Button right = kd.createButton( KeyEvent.VK_RIGHT ); JXVirtualInputDevice vd = JXInputManager.createVirtualDevice(); VirtualAxis vaileron = vd.createAxis( Axis.ID_X ); vaileron.setButtons( right, left ); vaileron.setTimeFor0To1( 1000 ); vaileron.setTimeFor1To0( 500 ); vaileron.setName( "Aileron" ); |
Or something that allows for 'overlaying' axes and 'or'-ing buttons:
1 2
| Axis aileron = new LatestChangedValueAxis( vaileron, mouseaileron ); Button trigger = new OrButton( joysticktrigger, mousetrigger ); |
FlyingGuns shows user extensions (that I may mave to JXInput). E.g. a '
MouseDevice'
that creates x/y axes from mouse movements.