User Tools

Site Tools


en:tutorials:remapping_inputs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:tutorials:remapping_inputs [2018/02/21 10:46 (2 months ago)]
sausage created
en:tutorials:remapping_inputs [2018/02/21 11:28 (2 months ago)] (current)
sausage
Line 89: Line 89:
 In remap mode, ''​orxInput_GetActiveBinding''​ is constantly called. This will get the very last input that was made whether it be a key, a mouse movement, a joystick press, etc. Here, if it was a joystick press, store it for later, and it will be used as the button to remap to. In remap mode, ''​orxInput_GetActiveBinding''​ is constantly called. This will get the very last input that was made whether it be a key, a mouse movement, a joystick press, etc. Here, if it was a joystick press, store it for later, and it will be used as the button to remap to.
  
-''​orxInput_GetBindingList''​ is then called which returns the entire list of bindings. ​All bindings from each input are retrieved.+''​orxInput_GetBindingList''​ is then called which returns the entire list of bindings ​to ''​XButton''​There can be up to four physical inputs to a binding. ''​orxINPUT_KU32_BINDING_NUMBER''​ is a constant to 4.
  
-We then loop through the entire list looking for any joystick button type input and unbind ''​Xbutton''​ from them.+We then loop through the entire list looking for any joystick button type input and unbind ''​XButton''​ from them.
  
-''​orxInput_Bind''​ is then called using the joystick button that was saved at the start using '​orxInput_GetActiveBinding''​. This is bound to ''​XButton''​.+''​orxInput_Bind''​ is then called using the joystick button that was saved at the start using ''​orxInput_GetActiveBinding''​. This is bound to ''​XButton''​.
  
 Finally, ''​orxInput_Save''​ is called to save the new input config section to a new file. This can then be loaded whenever your game is started. Finally, ''​orxInput_Save''​ is called to save the new input config section to a new file. This can then be loaded whenever your game is started.
  
 Finally remap mode is turned off, and if you press the new joystick button that you chose, it will start to log to console instead of the previous joystick button. Finally remap mode is turned off, and if you press the new joystick button that you chose, it will start to log to console instead of the previous joystick button.
en/tutorials/remapping_inputs.1519209993.txt.gz ยท Last modified: 2018/02/21 10:46 (2 months ago) by sausage