Raw Input
We very much recommend that you only use this if you can't use input actions for whatever reason. You can't rebind these at all.
We very much recommend that you only use this if you can't use input actions for whatever reason. You can't rebind these at all.
We have the ability to access keyboard inputs directly, bypassing input actions.
//
// Is the W key down this frame?
//
if ( Input.Keyboard.Down( "W" ) )
{
Log.Info( "W is down!" );
}
//
// Was the W key pressed this frame?
//
if ( Input.Keyboard.Pressed( "W" ) )
{
Log.Info( "W was pressed!" );
}
//
// Was the W key released this frame?
//
if ( Input.Keyboard.Released( "W" ) )
{
Log.Info( "W was released!" );
}
Most of the keys on the keyboard should work, here's an exhaustive list of them.
| Key | Name |
|---|---|
| "0" - "9" | 0 - 9 |
| "a" - "z" | A - Z |
| "KP_0" - "KP_9" | Numpad 0 - Numpad 9 |
| "KP_DIVIDE" | Numpad / |
| "KP_MULTIPLY" | Numpad * |
| "KP_MINUS" | Numpad - |
| "KP_PLUS" | Numpad + |
| "KP_ENTER" | Numpad Enter |
| "KP_DEL" | Numpad Delete |
| "<" | Less Than |
| ">" | More Than |
| "[" | Left Bracket |
| "]" | Right Bracket |
| "SEMICOLON" | Semicolon |
| " ' " | Apostrophe |
| " ` " | Backtick / Console Key |
| "," | Comma |
| "." | Period |
| "/" | Slash |
| "\\" | Backslash |
| "-" | Hyphen / Minus |
| "=" | Equals |
| "ENTER" | Enter |
| "SPACE" | Space |
| "BACKSPACE" | Backspace |
| "TAB" | Tab |
| "CAPSLOCK" | Caps Lock |
| "NUMLOCK" | Num Lock |
| "ESCAPE" | Escape |
| "SCROLLLOCK" | Scroll Lock |
| "INS" | Insert |
| "DEL" | Delete |
| "HOME" | Home |
| "END" | End |
| "PGUP" | Page Up |
| "PGDN" | Page Down |
| "PAUSE" | Pause |
| "SHIFT" | Left Shift |
| "RSHIFT" | Right Shift |
| "ALT" | Left Alt |
| "RALT" | Right Alt |
| "UPARROW" | Up Arrow |
| "LEFTARROW" | Left Arrow |
| "RIGHTARROW" | Right Arrow |
| "DOWNARROW" | Down Arrow |
Referenced API
Canonical API pages mentioned in this guide.
Editor.Frame
Like a widget - but is drawn
Sandbox.Audio.AudioMeter.Frame
No summary available.
Sandbox.Curve.Frame
Keyframes times and values should range between 0 and 1
Sandbox.Diagnostics.PerformanceStats.Timings.Frame
No summary available.
Sandbox.Gizmo.Pressed
Access to the currently pressed path information
Sandbox.Sprite.Frame
Describes a single animation frame
Sandbox.Input.Keyboard.Down(System.String)
Keyboard key is held down
Sandbox.Input.Keyboard.Pressed(System.String)
Keyboard key wasn't pressed but now it is