File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ Version 3
1010* Added a debug TimeSequenceState that can pop-up a time sync debug display.
1111* Added "Resume" menu item to the In-Game menu.
1212* Added an in-game "Help" pop-up mapping to the F1 key.
13+ * Added Gamepad mapping so "select" button will now open the in-game menu.
14+ * Added Gamepad mapping so the HAT will strafe/elevate.
1315
1416
1517Version 2
Original file line number Diff line number Diff line change 3737package example ;
3838
3939import com .jme3 .input .KeyInput ;
40+ import com .simsilica .lemur .input .Button ;
4041import com .simsilica .lemur .input .FunctionId ;
4142import com .simsilica .lemur .input .InputMapper ;
4243
@@ -61,6 +62,8 @@ public class MainGameFunctions {
6162 public static void initializeDefaultMappings ( InputMapper inputMapper ) {
6263
6364 inputMapper .map (F_IN_GAME_MENU , KeyInput .KEY_ESCAPE );
65+ inputMapper .map (F_IN_GAME_MENU , Button .JOYSTICK_SELECT ); // the normal one
66+ inputMapper .map (F_IN_GAME_MENU , Button .JOYSTICK_BUTTON8 ); // just in case it's not a gamepad
6467 inputMapper .map (F_IN_GAME_HELP , KeyInput .KEY_F1 );
6568
6669 inputMapper .map (F_TIME_DEBUG , KeyInput .KEY_F7 );
Original file line number Diff line number Diff line change @@ -93,13 +93,17 @@ public static void initializeDefaultMappings( InputMapper inputMapper ) {
9393 inputMapper .map (F_STRAFE , Axis .JOYSTICK_LEFT_X );
9494 inputMapper .map (F_STRAFE , KeyInput .KEY_D );
9595 inputMapper .map (F_STRAFE , InputState .Negative , KeyInput .KEY_A );
96+
97+ inputMapper .map (F_STRAFE , Axis .JOYSTICK_HAT_X );
9698 }
9799
98100 if ( !inputMapper .hasMappings (F_ELEVATE ) ) {
99101 // Elevation only has key mappings but we still treat it like
100102 // one "axis".
101103 inputMapper .map (F_ELEVATE , KeyInput .KEY_Q );
102104 inputMapper .map (F_ELEVATE , InputState .Negative , KeyInput .KEY_Z );
105+
106+ inputMapper .map (F_ELEVATE , Axis .JOYSTICK_HAT_Y );
103107 }
104108
105109 if ( !inputMapper .hasMappings (F_X_ROTATE ) ) {
Original file line number Diff line number Diff line change 1616 <Loggers >
1717 <Logger name =" example" level =" DEBUG" />
1818 <Logger name =" com.simsilica.sim" level =" TRACE" />
19+ <!-- <Logger name="com.simsilica.lemur.input.InputMapper" level="TRACE"/> -->
1920 <!-- <Logger name="com.simsilica.lemur.CallMethodAction" level="TRACE"/> -->
2021 <Root level =" INFO" >
2122 <AppenderRef ref =" RollingFile" />
You can’t perform that action at this time.
0 commit comments