Jump to content

custom input setting for user


Anicet
 Share

Recommended Posts

Hi, I am trying to make a menu which lets the user bind the in-game inputs. But I have no idea how to do that... Maybe there is a way to detect which input he presses and then use this information when creating input...

Thanks beforehand.

Link to comment
Share on other sites

Hello,

I would do something like that :

-> set a callback to the "onkeypress" event, this function will detect which key was pressed and then call the associated action
-> in the user cookies, make a hash keycode=>event (eg: A is 'move_left')
-> then in your callback function when you detect A you know that the user wants to 'move_left'

of course when your user want to change his bindings you have to change the cookie too

Hope it helps

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...