About This File
Key.Bind - This function binds the key.
- keycode - hexadecimal code of key.
- keydown/keyup - true trigges on keydown, false triggers on keyup (bool)
- handler - function-handler.
public class KeyTest: RAGE.Events.Script { public KeyTest() { Key.Bind(Keys.VK_ESCAPE, true, () => { // Code here return 1; }); } }
To bind multiple keys:
Key.Bind(new Keys[] { Keys.VK_T, Keys.VK_F6 }, true, ...)
Key.IsUp - Returns true if the key specified has been released. Otherwise, returns false.
- keycode - code of the key (Keys.VK_T or 0x54)
private void Tick(List<Events.TickNametagData> nametags) { if(Key.IsUp(0x62)) { // NUMPAD2 up } }
Key.IsDown - Returns true if the key specified is pressed. Otherwise, returns false.
- keycode - code of the key
private void Tick(List<Events.TickNametagData> nametags) { if(Key.IsDown(new int[] { 0x60, 0x61 })) { // NUMPAD0 & NUMPAD1 pressed. } }