It looks like you're new here. If you want to get involved, click one of these buttons!
g_keyleft = KeyCode.LEFT local textInputDialog = TextInputDialog.new("assign new key", "LEFT", g_keyleft, "Cancel", "OK") local function onComplete(event) print(event.text, event.buttonIndex, event.buttonText) end textInputDialog:addEventListener(Event.COMPLETE, onComplete) textInputDialog:show() |
Comments
1- the user presses the button to remap the left direction
2- button blinks (or changes color, ...)
3- user presses the new key
4- game uses the new key
You can use utf8.char() to convert a key code to a character. Example:
I also find this stage:addEventListener(Event.KEY_CHAR, onKeyChar) which is not documented
Likes: E1e5en
By clicking on the mouse button, the editing mode is activated and you can drive in a key from the keyboard. There you can check which buttons can be assigned and which cannot.
Project: link
Likes: MoKaLux