So, I've done some experimenting, and researching for different types of ways to Map keyboard buttons. I looked at Control X for that. Unfortunately, the control options for the player are STILL limited up to Fire 4 buttons. So I looked to see if any other extensions could work for me.
I looked on Google for the answer, if anyone else had any similar trouble. Eventually I found this topic on the forum:
Last post was on 2014. However, the example MFA file that AndyBazooka posted is EXACTLY what I am looking for. The Keyboard Object used in the example seems to go beyond the 4 button fire limit, so I gave that example a quick test run. Although I have some questions and/or concerns relating to it.
I actually made a revision/update of the users key mapping example to test controlling the player's movement.
See attachment download below.
Now my question are:
- How do I detect same key presses with this? What I want to happen is if the user presses 'Arrow Up' for both up and down, I do NOT want to go to the next key map unless a new button is pressed. In other words, the key mapper should NOT proceed if the same key is pressed more than once. Likewise if the user has 'Arrow Up' for Up, then 'Left arrow' for left, then proceeded to the button for shooting or jumping, pressing 'Up Arrow' will NOT proceed. How do I do this?
- Once these keys are set up, I've saved the key press values in the global object to stay through multiple frames. Do I need to use something like INI object, or some other file saving object so the user won't have to keep remapping the keys every time they load the game?
- I'm kind of curious as to how this is set up. Is it possible for me to change this set up so the control config is NOT in list order? Like, when the user goes into the key config menu screen, they have to highlight a specific button they want to map first. Then they press a key to map, then go to select another key to map.
I really like this set up in the attachment. I'm just worried there could be some complications, or it is a forced list from top to bottom to configure the controls.
- Another thing I noticed. If you click on one of the control mappers in the list, the alterable values will get 'desynced' from what you are supposed to map. So you get awkward key mapped controls. The only thing I can think of to fix this is to set up a different key mapping script similar to this example, but which it does NOT use the list object. I tried to always lose focus, but it didn't help much. When I set the condition Always -> List Object -> Control -> Disable, that seemed to help a little, though it's probably not the best solution. The other alternate being is to have that list off screen, AND disable perhaps. If anyone else has any ideas what I can do to have this similar set up besides the list object, that would be great.
Any help would be appreciated.