[C#] Key API 1.0

   (1 review)
Sign in to follow this  

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)
    // 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.


User Feedback

Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now