First of all, more key conditionals
if key pressed = left
if key released = right
if key = jump
Second, allow us to put more keybinds
if key = custom 1
if key pressed = custom 3
Third, allow us to check for an specific key, not related to a keybind
if key pressed = 32 //Space
if key = 48 //Key 0
if key = 88 //X key
if key released = g1 //g means any button from a gamepad, idk which numbers to use for each
The values are from here:
https://www.asciitable.comFourth, allow us to set, change, etc. keybinds from commands, allowing us to create custom control config menus.
player 1 keybind left = [last key] //Set player 1's left keybind to the last keyboard key pressed.
player 2 keybind jump = 88 //Sets player 2's keybind jump to X button from keyboard
player 1 keybind custom 1 = g2 //Sets player 1's custom keybind with id 1 to the gamepad button with id 2
player 2 keybind shoot = [last button] //Sets default player 2's shoot keybind to the last gamepad button
Obvioulsy this gives us some more bracketings
[player (1|2) keybind (keybind name)] //Returns the ascii value of that keybind
[last key] //Last keyboard button pressed by the user
[last button] //Last gamepad button pressed by the user.
//Useful for this
if key pressed = [player 1 keybind custom 1]
{
//Do things
}
//or
if key pressed = custom 1
{
//Do things
}
//But this leaves PB free to choose which player is intended to get the keybind from