Input
Functions
Process Events
ProcessEvents allows SplashKit to react to user interactions. This procedure checks the current keyboard and mouse states and should be called once within your game loop to check user interaction. Side Effects - Reads user interaction events - Updates keys down, text input, etc.
Signatures:
void process_events()
public static void SplashKit.ProcessEvents();
def process_events():
procedure ProcessEvents()
Usage:
Quit Requested
Checks to see if the user has asked for the application to quit. This value is updated by the Process Events
routine. Also see window_close_requested
.
Return Type: Boolean
Signatures:
bool quit_requested()
public static bool SplashKit.QuitRequested();
def quit_requested():
function QuitRequested(): Boolean
Usage:
Reset Quit
Cancels a quit request, ensuring the quit requested will return false.
Signatures:
void reset_quit()
public static void SplashKit.ResetQuit();
def reset_quit():
procedure ResetQuit()
Any Key Pressed
Checks to see if any key has been pressed since the last time Process Events
was called.
Return Type: Boolean
Signatures:
bool any_key_pressed()
public static bool SplashKit.AnyKeyPressed();
def any_key_pressed():
function AnyKeyPressed(): Boolean
Usage:
Deregister Callback On Key Down
Remove the registered callback from receiving events related to key down actions.
Parameters:
Name | Type | Description |
---|---|---|
callback | Key Callback | The function to from from key down events |
Signatures:
void deregister_callback_on_key_down(key_callback *callback)
public static void SplashKit.DeregisterCallbackOnKeyDown(KeyCallback callback);
def deregister_callback_on_key_down(callback):
procedure DeregisterCallbackOnKeyDown(callback: KeyCallback)
Deregister Callback On Key Typed
Remove the registered callback from receiving events related to key typed actions.
Parameters:
Name | Type | Description |
---|---|---|
callback | Key Callback | The function to from from key typed events |
Signatures:
void deregister_callback_on_key_typed(key_callback *callback)
public static void SplashKit.DeregisterCallbackOnKeyTyped(KeyCallback callback);
def deregister_callback_on_key_typed(callback):
procedure DeregisterCallbackOnKeyTyped(callback: KeyCallback)
Deregister Callback On Key Up
Remove the registered callback from receiving events related to key up actions.
Parameters:
Name | Type | Description |
---|---|---|
callback | Key Callback | The function to from from key up events |
Signatures:
void deregister_callback_on_key_up(key_callback *callback)
public static void SplashKit.DeregisterCallbackOnKeyUp(KeyCallback callback);
def deregister_callback_on_key_up(callback):
procedure DeregisterCallbackOnKeyUp(callback: KeyCallback)
Key Down
Returns true when the key requested is being held down. This is updated as part of the Process Events
call. Use the key codes from Key Code
to specify the key to be checked.
Parameters:
Name | Type | Description |
---|---|---|
key | Key Code | The key to check if it is down |
Return Type: Boolean
Signatures:
bool key_down(key_code key)
public static bool SplashKit.KeyDown(KeyCode key);
def key_down(key):
function KeyDown(key: KeyCode): Boolean
Usage:
Key Name
The Key Name
function returns a string name for a given Key Code
. For example, COMMA_KEY
returns the string ‘Comma’. This function could be used to display more meaningful key names for configuring game controls, etc.
Parameters:
Name | Type | Description |
---|---|---|
key | Key Code | The key to get the name of |
Return Type: String
Signatures:
string key_name(key_code key)
public static string SplashKit.KeyName(KeyCode key);
def key_name(key):
function KeyName(key: KeyCode): String
Key Released
Returns true if the specified key was released since the last time Process Events
was called. This occurs only once for the key that is released and will not return true again until the key is pressed down and released again.
Parameters:
Name | Type | Description |
---|---|---|
key | Key Code | The key to check if it was released |
Return Type: Boolean
Signatures:
bool key_released(key_code key)
public static bool SplashKit.KeyReleased(KeyCode key);
def key_released(key):
function KeyReleased(key: KeyCode): Boolean
Key Typed
Returns true when the key requested is just pressed down. This is updated as part of the Process Events
call. Use the key codes from Key Code
to specify the key to be checked. this will only occur once for that key that is pressed and will not return true again until the key is released and presssed down again
Parameters:
Name | Type | Description |
---|---|---|
key | Key Code | The key to check if it was typed |
Return Type: Boolean
Signatures:
bool key_typed(key_code key)
public static bool SplashKit.KeyTyped(KeyCode key);
def key_typed(key):
function KeyTyped(key: KeyCode): Boolean
Usage:
Key Up
Returns false when the key requested is being held down. This is updated as part of the Process Events
call. Use the key codes from Key Code
to specify the key to be checked.
Parameters:
Name | Type | Description |
---|---|---|
key | Key Code | The key to check if it is up |
Return Type: Boolean
Signatures:
bool key_up(key_code key)
public static bool SplashKit.KeyUp(KeyCode key);
def key_up(key):
function KeyUp(key: KeyCode): Boolean
Register Callback On Key Down
Register the passed in callback function to receive notification of key down calls. This will be called in response to Process Events
, for each key that the user presses down.
Parameters:
Name | Type | Description |
---|---|---|
callback | Key Callback | The function to be called when a key is first pressed |
Signatures:
void register_callback_on_key_down(key_callback *callback)
public static void SplashKit.RegisterCallbackOnKeyDown(KeyCallback callback);
def register_callback_on_key_down(callback):
procedure RegisterCallbackOnKeyDown(callback: KeyCallback)
Register Callback On Key Typed
Register the passed in callback function to receive notification of key typed calls. This will be called in response to Process Events
, when the user initially presses a key down.
Parameters:
Name | Type | Description |
---|---|---|
callback | Key Callback | The function to be called when a key is typed |
Signatures:
void register_callback_on_key_typed(key_callback *callback)
public static void SplashKit.RegisterCallbackOnKeyTyped(KeyCallback callback);
def register_callback_on_key_typed(callback):
procedure RegisterCallbackOnKeyTyped(callback: KeyCallback)
Register Callback On Key Up
Register the passed in callback function to receive notification of key up calls. This will be called in response to Process Events
, for each key that the user releases.
Parameters:
Name | Type | Description |
---|---|---|
callback | Key Callback | The function to be called when a key is released |
Signatures:
void register_callback_on_key_up(key_callback *callback)
public static void SplashKit.RegisterCallbackOnKeyUp(KeyCallback callback);
def register_callback_on_key_up(callback):
procedure RegisterCallbackOnKeyUp(callback: KeyCallback)
Hide Mouse
Tells the mouse cursor to hide (no longer visible) if it is currently showing. Use ShowMouse
to make the mouse cursor visible again.
Signatures:
void hide_mouse()
public static void SplashKit.HideMouse();
def hide_mouse():
procedure HideMouse()
Mouse Clicked
Returns true if the specified button was clicked since the last time Process Events
was called.
Parameters:
Name | Type | Description |
---|---|---|
button | Mouse Button | The mouse button to check |
Return Type: Boolean
Signatures:
bool mouse_clicked(mouse_button button)
public static bool SplashKit.MouseClicked(MouseButton button);
def mouse_clicked(button):
function MouseClicked(button: MouseButton): Boolean
Usage:
Mouse Down
Returns true
if the specified button is currently pressed down.
Parameters:
Name | Type | Description |
---|---|---|
button | Mouse Button | The mouse button to check |
Return Type: Boolean
Signatures:
bool mouse_down(mouse_button button)
public static bool SplashKit.MouseDown(MouseButton button);
def mouse_down(button):
function MouseDown(button: MouseButton): Boolean
Usage:
Mouse Movement
Returns the amount of accumulated mouse movement, since the last time Process Events
was called, as a Vector 2d
.
Return Type: Vector 2d
Signatures:
vector_2d mouse_movement()
public static Vector2D SplashKit.MouseMovement();
def mouse_movement():
function MouseMovement(): Vector2D
Usage:
Mouse Position
Returns the current window position of the mouse as a Point2D
Return Type: Point 2d
Signatures:
point_2d mouse_position()
public static Point2D SplashKit.MousePosition();
def mouse_position():
function MousePosition(): Point2D
Mouse Position Vector
Returns The current window position of the mouse as a Vector
Return Type: Vector 2d
Signatures:
vector_2d mouse_position_vector()
public static Vector2D SplashKit.MousePositionVector();
def mouse_position_vector():
function MousePositionVector(): Vector2D
Mouse Shown
Returns true
if the mouse is currently visible, false
if not.
Return Type: Boolean
Signatures:
bool mouse_shown()
public static bool SplashKit.MouseShown();
def mouse_shown():
function MouseShown(): Boolean
Mouse Up
Returns true
if the specified button is currently up.
Parameters:
Name | Type | Description |
---|---|---|
button | Mouse Button | The mouse button to check |
Return Type: Boolean
Signatures:
bool mouse_up(mouse_button button)
public static bool SplashKit.MouseUp(MouseButton button);
def mouse_up(button):
function MouseUp(button: MouseButton): Boolean
Usage:
Mouse Wheel Scroll
Returns the amount the mouse wheel was scrolled since the last call to Process Events
. The result is a vector containing the x and y amounts scrolled. Scroll left generates a negative x, scroll right a positive x. Scroll backward is negative y, scroll forward positive y. Note that on MacOS the directions may be inverted by OS settings.
Return Type: Vector 2d
Signatures:
vector_2d mouse_wheel_scroll()
public static Vector2D SplashKit.MouseWheelScroll();
def mouse_wheel_scroll():
function MouseWheelScroll(): Vector2D
Mouse X
Returns the current x value of the mouse’s position.
Return Type: Float
Signatures:
float mouse_x()
public static float SplashKit.MouseX();
def mouse_x():
function MouseX(): Single
Mouse Y
Returns the current y value of the mouse’s position.
Return Type: Float
Signatures:
float mouse_y()
public static float SplashKit.MouseY();
def mouse_y():
function MouseY(): Single
Move Mouse
Move Mouse
Moves the mouse cursor to the specified screen location.
Parameters:
Name | Type | Description |
---|---|---|
x | Double | The new x location of the mouse |
y | Double | The new y location of the mouse |
Signatures:
void move_mouse(double x, double y)
public static void SplashKit.MoveMouse(double x, double y);
def move_mouse(x, y):
procedure MoveMouse(x: Double; y: Double)
Move Mouse
Moves the mouse cursor to the specified screen location.
Parameters:
Name | Type | Description |
---|---|---|
point | Point 2d | The new location of the mouse |
Signatures:
void move_mouse(point_2d point)
public static void SplashKit.MoveMouse(Point2D point);
def move_mouse_to_point(point):
procedure MoveMouse(point: Point2D)
Show Mouse
Show Mouse
Tells the mouse cursor to be visible if it was previously hidden with by a HideMouse
or SetMouseVisible
(False) call.
Signatures:
void show_mouse()
public static void SplashKit.ShowMouse();
def show_mouse():
procedure ShowMouse()
Show Mouse
Used to explicitly set the mouse cursors visible state (if it is showing in the window or not) based on the show parameter.
Parameters:
Name | Type | Description |
---|---|---|
show | Boolean | When true the mouse is shown, when false it is hidden |
Signatures:
void show_mouse(bool show)
public static void SplashKit.ShowMouse(bool show);
def show_mouse_with_boolean(show):
procedure ShowMouse(show: Boolean)
Draw Collected Text
Draw the text that the user is currently enterring on the current window.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The color for the text |
fnt | Font | The font to use |
font_size | Integer | The size of the font |
opts | Drawing Options | Any drawing options |
Signatures:
void draw_collected_text(color clr, font fnt, int font_size, const drawing_options &opts)
public static void SplashKit.DrawCollectedText(Color clr, Font fnt, int fontSize, DrawingOptions opts);
def draw_collected_text(clr, fnt, font_size, opts):
procedure DrawCollectedText(clr: Color; fnt: Font; fontSize: Integer; const opts: DrawingOptions)
Usage:
End Reading Text
End Reading Text
Ends reading text in for the current window.
Signatures:
void end_reading_text()
public static void SplashKit.EndReadingText();
def end_reading_text():
procedure EndReadingText()
End Reading Text
Ends reading text for the passed in window.
Parameters:
Name | Type | Description |
---|---|---|
wind | Window | The window to end reading text |
Signatures:
void end_reading_text(window wind)
public static void SplashKit.EndReadingText(Window wind);
def end_reading_text_in_window(wind):
procedure EndReadingText(wind: Window)
Reading Text
Reading Text
Returns true when the current window is reading text.
Return Type: Boolean
Signatures:
bool reading_text()
public static bool SplashKit.ReadingText();
def reading_text():
function ReadingText(): Boolean
Usage:
Reading Text
Returns true when the window is reading text.
Parameters:
Name | Type | Description |
---|---|---|
wind | Window | The window to check |
Return Type: Boolean
Signatures:
bool reading_text(window wind)
public static bool SplashKit.ReadingText(Window wind);
def reading_text_in_window(wind):
function ReadingText(wind: Window): Boolean
Start Reading Text
Start Reading Text
Start reading text in the current window within the bounds of the supplied rectangle.
Parameters:
Name | Type | Description |
---|---|---|
rect | Rectangle | The area where the text will be entered. |
Signatures:
void start_reading_text(rectangle rect)
public static void SplashKit.StartReadingText(Rectangle rect);
def start_reading_text(rect):
procedure StartReadingText(rect: Rectangle)
Usage:
Start Reading Text
Start reading text in the current window within the bounds of the supplied rectangle. The text will start with an initial value.
Parameters:
Name | Type | Description |
---|---|---|
rect | Rectangle | The area where the text will be entered. |
initial_text | String | The initial text, which may be edited by the user. |
Signatures:
void start_reading_text(rectangle rect, string initial_text)
public static void SplashKit.StartReadingText(Rectangle rect, string initialText);
def start_reading_text_with_initial_text(rect, initial_text):
procedure StartReadingText(rect: Rectangle; initialText: String)
Start Reading Text
Start reading text in the window within the bounds of the supplied rectangle.
Parameters:
Name | Type | Description |
---|---|---|
wind | Window | The window where the text will be entered |
rect | Rectangle | The area where the text will be entered. |
Signatures:
void start_reading_text(window wind, rectangle rect)
public static void SplashKit.StartReadingText(Window wind, Rectangle rect);
def start_reading_text_in_window(wind, rect):
procedure StartReadingText(wind: Window; rect: Rectangle)
Start Reading Text
Start reading text in the window within the bounds of the supplied rectangle. The text will start with an initial value.
Parameters:
Name | Type | Description |
---|---|---|
wind | Window | The window where the text will be entered |
rect | Rectangle | The area where the text will be entered. |
initial_text | String | The initial text, which may be edited by the user. |
Signatures:
void start_reading_text(window wind, rectangle rect, string initial_text)
public static void SplashKit.StartReadingText(Window wind, Rectangle rect, string initialText);
def start_reading_text_in_window_with_initial_text(wind, rect, initial_text):
procedure StartReadingText(wind: Window; rect: Rectangle; initialText: String)
Text Entry Cancelled
Text Entry Cancelled
Did the user press escape and cancel the enterring of text?
Return Type: Boolean
Signatures:
bool text_entry_cancelled()
public static bool SplashKit.TextEntryCancelled();
def text_entry_cancelled():
function TextEntryCancelled(): Boolean
Usage:
Text Entry Cancelled
Did the user press escape and cancel the enterring of text?
Parameters:
Name | Type | Description |
---|---|---|
wind | Window | The window to check |
Return Type: Boolean
Signatures:
bool text_entry_cancelled(window wind)
public static bool SplashKit.TextEntryCancelled(Window wind);
def text_entry_cancelled_in_window(wind):
function TextEntryCancelled(wind: Window): Boolean
Text Input
Text Input
The text the user has currently enterred on the current window.
Return Type: String
Signatures:
string text_input()
public static string SplashKit.TextInput();
def text_input():
function TextInput(): String
Usage:
Text Input
The text the user has currently enterred on the current window.
Parameters:
Name | Type | Description |
---|---|---|
wind | Window | The window to check |
Return Type: String
Signatures:
string text_input(window wind)
public static string SplashKit.TextInput(Window wind);
def text_input_in_window(wind):
function TextInput(wind: Window): String
Types
Key Callback
The Key Callback
is a function pointer used to register your code with SplashKit
or keyboard related events. See Register Callback On Key Down
,
Register Callback On Key Up
, and Register Callback On Key Typed
Key Code
Constant | Description |
---|---|
UNKNOWN_KEY | The unknown key |
BACKSPACE_KEY | The backspace key |
TAB_KEY | The tab key |
CLEAR_KEY | The clear key |
RETURN_KEY | The return key |
PAUSE_KEY | The pause key |
ESCAPE_KEY | The escape key |
SPACE_KEY | The space key |
EXCLAIM_KEY | The exclaim key |
DOUBLE_QUOTE_KEY | The double quote key |
HASH_KEY | The hash key |
DOLLAR_KEY | The dollar key |
AMPERSAND_KEY | The ampersand key |
QUOTE_KEY | The quote key |
LEFT_PAREN_KEY | The left paren key |
RIGHT_PAREN_KEY | The right paren key |
ASTERISK_KEY | The asterisk key |
PLUS_KEY | The plus key |
COMMA_KEY | The comma key |
MINUS_KEY | The minus key |
PERIOD_KEY | The period key |
SLASH_KEY | The slash key |
NUM_0_KEY | The num 0 key |
NUM_1_KEY | The num 1 key |
NUM_2_KEY | The num 2 key |
NUM_3_KEY | The num 3 key |
NUM_4_KEY | The num 4 key |
NUM_5_KEY | The num 5 key |
NUM_6_KEY | The num 6 key |
NUM_7_KEY | The num 7 key |
NUM_8_KEY | The num 8 key |
NUM_9_KEY | The num 9 key |
COLON_KEY | The colon key |
SEMI_COLON_KEY | The semi colon key |
LESS_KEY | The less key |
EQUALS_KEY | The equals key |
GREATER_KEY | The greater key |
QUESTION_KEY | The question key |
AT_KEY | The at key |
LEFT_BRACKET_KEY | The left bracket key |
BACKSLASH_KEY | The backslash () key |
RIGHT_BRACKET_KEY | The right bracket key |
CARET_KEY | The caret (^) key |
UNDERSCORE_KEY | The underscore (_) key |
BACKQUOTE_KEY | The backquote (`) key |
A_KEY | The a key |
B_KEY | The b key |
C_KEY | The c key |
D_KEY | The d key |
E_KEY | The e key |
F_KEY | The f key |
G_KEY | The g key |
H_KEY | The h key |
I_KEY | The i key |
J_KEY | The j key |
K_KEY | The k key |
L_KEY | The l key |
M_KEY | The m key |
N_KEY | The n key |
O_KEY | The o key |
P_KEY | The p key |
Q_KEY | The q key |
R_KEY | The r key |
S_KEY | The s key |
T_KEY | The t key |
U_KEY | The u key |
V_KEY | The v key |
W_KEY | The w key |
X_KEY | The x key |
Y_KEY | The y key |
Z_KEY | The z key |
DELETE_KEY | The delete key |
KEYPAD_0 | The keypad 0 key |
KEYPAD_1 | The keypad 1 key |
KEYPAD_2 | The keypad 2 key |
KEYPAD_3 | The keypad 3 key |
KEYPAD_4 | The keypad 4 key |
KEYPAD_5 | The keypad 5 key |
KEYPAD_6 | The keypad 6 key |
KEYPAD_7 | The keypad 7 key |
KEYPAD_8 | The keypad 8 key |
KEYPAD_9 | The keypad 9 key |
KEYPAD_PERIOD | The keypad period key |
KEYPAD_DIVIDE | The keypad divide key |
KEYPAD_MULTIPLY | The keypad multiply key |
KEYPAD_MINUS | The keypad minus key |
KEYPAD_PLUS | The keypad plus key |
KEYPAD_ENTER | The keypad enter key |
KEYPAD_EQUALS | The keypad equals key |
UP_KEY | The up key |
DOWN_KEY | The down key |
RIGHT_KEY | The right key |
LEFT_KEY | The left key |
INSERT_KEY | The insert key |
HOME_KEY | The home key |
END_KEY | The end key |
PAGE_UP_KEY | The page up key |
PAGE_DOWN_KEY | The page down key |
F1_KEY | The f1 key |
F2_KEY | The f2 key |
F3_KEY | The f3 key |
F4_KEY | The f4 key |
F5_KEY | The f5 key |
F6_KEY | The f6 key |
F7_KEY | The f7 key |
F8_KEY | The f8 key |
F9_KEY | The f9 key |
F10_KEY | The f10 key |
F11_KEY | The f11 key |
F12_KEY | The f12 key |
F13_KEY | The f13 key |
F14_KEY | The f14 key |
F15_KEY | The f15 key |
NUM_LOCK_KEY | The num lock key |
CAPS_LOCK_KEY | The caps lock key |
SCROLL_LOCK_KEY | The scroll lock key |
RIGHT_SHIFT_KEY | The right shift key |
LEFT_SHIFT_KEY | The left shift key |
RIGHT_CTRL_KEY | The right ctrl key |
LEFT_CTRL_KEY | The left ctrl key |
RIGHT_ALT_KEY | The right alt or option key |
LEFT_ALT_KEY | The left alt or option key |
LEFT_SUPER_KEY | The left super (windows or command) key |
RIGHT_SUPER_KEY | The right super (windows or command) key |
MODE_KEY | The mode key |
HELP_KEY | The help key |
SYS_REQ_KEY | The sys req key |
MENU_KEY | The menu key |
POWER_KEY | The power key |
Constant | Description |
---|---|
KeyCode.UnknownKey | The unknown key |
KeyCode.BackspaceKey | The backspace key |
KeyCode.TabKey | The tab key |
KeyCode.ClearKey | The clear key |
KeyCode.ReturnKey | The return key |
KeyCode.PauseKey | The pause key |
KeyCode.EscapeKey | The escape key |
KeyCode.SpaceKey | The space key |
KeyCode.ExclaimKey | The exclaim key |
KeyCode.DoubleQuoteKey | The double quote key |
KeyCode.HashKey | The hash key |
KeyCode.DollarKey | The dollar key |
KeyCode.AmpersandKey | The ampersand key |
KeyCode.QuoteKey | The quote key |
KeyCode.LeftParenKey | The left paren key |
KeyCode.RightParenKey | The right paren key |
KeyCode.AsteriskKey | The asterisk key |
KeyCode.PlusKey | The plus key |
KeyCode.CommaKey | The comma key |
KeyCode.MinusKey | The minus key |
KeyCode.PeriodKey | The period key |
KeyCode.SlashKey | The slash key |
KeyCode.Num0Key | The num 0 key |
KeyCode.Num1Key | The num 1 key |
KeyCode.Num2Key | The num 2 key |
KeyCode.Num3Key | The num 3 key |
KeyCode.Num4Key | The num 4 key |
KeyCode.Num5Key | The num 5 key |
KeyCode.Num6Key | The num 6 key |
KeyCode.Num7Key | The num 7 key |
KeyCode.Num8Key | The num 8 key |
KeyCode.Num9Key | The num 9 key |
KeyCode.ColonKey | The colon key |
KeyCode.SemiColonKey | The semi colon key |
KeyCode.LessKey | The less key |
KeyCode.EqualsKey | The equals key |
KeyCode.GreaterKey | The greater key |
KeyCode.QuestionKey | The question key |
KeyCode.AtKey | The at key |
KeyCode.LeftBracketKey | The left bracket key |
KeyCode.BackslashKey | The backslash () key |
KeyCode.RightBracketKey | The right bracket key |
KeyCode.CaretKey | The caret (^) key |
KeyCode.UnderscoreKey | The underscore (_) key |
KeyCode.BackquoteKey | The backquote (`) key |
KeyCode.AKey | The a key |
KeyCode.BKey | The b key |
KeyCode.CKey | The c key |
KeyCode.DKey | The d key |
KeyCode.EKey | The e key |
KeyCode.FKey | The f key |
KeyCode.GKey | The g key |
KeyCode.HKey | The h key |
KeyCode.IKey | The i key |
KeyCode.JKey | The j key |
KeyCode.KKey | The k key |
KeyCode.LKey | The l key |
KeyCode.MKey | The m key |
KeyCode.NKey | The n key |
KeyCode.OKey | The o key |
KeyCode.PKey | The p key |
KeyCode.QKey | The q key |
KeyCode.RKey | The r key |
KeyCode.SKey | The s key |
KeyCode.TKey | The t key |
KeyCode.UKey | The u key |
KeyCode.VKey | The v key |
KeyCode.WKey | The w key |
KeyCode.XKey | The x key |
KeyCode.YKey | The y key |
KeyCode.ZKey | The z key |
KeyCode.DeleteKey | The delete key |
KeyCode.Keypad0 | The keypad 0 key |
KeyCode.Keypad1 | The keypad 1 key |
KeyCode.Keypad2 | The keypad 2 key |
KeyCode.Keypad3 | The keypad 3 key |
KeyCode.Keypad4 | The keypad 4 key |
KeyCode.Keypad5 | The keypad 5 key |
KeyCode.Keypad6 | The keypad 6 key |
KeyCode.Keypad7 | The keypad 7 key |
KeyCode.Keypad8 | The keypad 8 key |
KeyCode.Keypad9 | The keypad 9 key |
KeyCode.KeypadPeriod | The keypad period key |
KeyCode.KeypadDivide | The keypad divide key |
KeyCode.KeypadMultiply | The keypad multiply key |
KeyCode.KeypadMinus | The keypad minus key |
KeyCode.KeypadPlus | The keypad plus key |
KeyCode.KeypadEnter | The keypad enter key |
KeyCode.KeypadEquals | The keypad equals key |
KeyCode.UpKey | The up key |
KeyCode.DownKey | The down key |
KeyCode.RightKey | The right key |
KeyCode.LeftKey | The left key |
KeyCode.InsertKey | The insert key |
KeyCode.HomeKey | The home key |
KeyCode.EndKey | The end key |
KeyCode.PageUpKey | The page up key |
KeyCode.PageDownKey | The page down key |
KeyCode.F1Key | The f1 key |
KeyCode.F2Key | The f2 key |
KeyCode.F3Key | The f3 key |
KeyCode.F4Key | The f4 key |
KeyCode.F5Key | The f5 key |
KeyCode.F6Key | The f6 key |
KeyCode.F7Key | The f7 key |
KeyCode.F8Key | The f8 key |
KeyCode.F9Key | The f9 key |
KeyCode.F10Key | The f10 key |
KeyCode.F11Key | The f11 key |
KeyCode.F12Key | The f12 key |
KeyCode.F13Key | The f13 key |
KeyCode.F14Key | The f14 key |
KeyCode.F15Key | The f15 key |
KeyCode.NumLockKey | The num lock key |
KeyCode.CapsLockKey | The caps lock key |
KeyCode.ScrollLockKey | The scroll lock key |
KeyCode.RightShiftKey | The right shift key |
KeyCode.LeftShiftKey | The left shift key |
KeyCode.RightCtrlKey | The right ctrl key |
KeyCode.LeftCtrlKey | The left ctrl key |
KeyCode.RightAltKey | The right alt or option key |
KeyCode.LeftAltKey | The left alt or option key |
KeyCode.LeftSuperKey | The left super (windows or command) key |
KeyCode.RightSuperKey | The right super (windows or command) key |
KeyCode.ModeKey | The mode key |
KeyCode.HelpKey | The help key |
KeyCode.SysReqKey | The sys req key |
KeyCode.MenuKey | The menu key |
KeyCode.PowerKey | The power key |
Constant | Description |
---|---|
key_code.unknown_key | The unknown key |
key_code.backspace_key | The backspace key |
key_code.tab_key | The tab key |
key_code.clear_key | The clear key |
key_code.return_key | The return key |
key_code.pause_key | The pause key |
key_code.escape_key | The escape key |
key_code.space_key | The space key |
key_code.exclaim_key | The exclaim key |
key_code.double_quote_key | The double quote key |
key_code.hash_key | The hash key |
key_code.dollar_key | The dollar key |
key_code.ampersand_key | The ampersand key |
key_code.quote_key | The quote key |
key_code.left_paren_key | The left paren key |
key_code.right_paren_key | The right paren key |
key_code.asterisk_key | The asterisk key |
key_code.plus_key | The plus key |
key_code.comma_key | The comma key |
key_code.minus_key | The minus key |
key_code.period_key | The period key |
key_code.slash_key | The slash key |
key_code.num_0_key | The num 0 key |
key_code.num_1_key | The num 1 key |
key_code.num_2_key | The num 2 key |
key_code.num_3_key | The num 3 key |
key_code.num_4_key | The num 4 key |
key_code.num_5_key | The num 5 key |
key_code.num_6_key | The num 6 key |
key_code.num_7_key | The num 7 key |
key_code.num_8_key | The num 8 key |
key_code.num_9_key | The num 9 key |
key_code.colon_key | The colon key |
key_code.semi_colon_key | The semi colon key |
key_code.less_key | The less key |
key_code.equals_key | The equals key |
key_code.greater_key | The greater key |
key_code.question_key | The question key |
key_code.at_key | The at key |
key_code.left_bracket_key | The left bracket key |
key_code.backslash_key | The backslash () key |
key_code.right_bracket_key | The right bracket key |
key_code.caret_key | The caret (^) key |
key_code.underscore_key | The underscore (_) key |
key_code.backquote_key | The backquote (`) key |
key_code.a_key | The a key |
key_code.b_key | The b key |
key_code.c_key | The c key |
key_code.d_key | The d key |
key_code.e_key | The e key |
key_code.f_key | The f key |
key_code.g_key | The g key |
key_code.h_key | The h key |
key_code.i_key | The i key |
key_code.j_key | The j key |
key_code.k_key | The k key |
key_code.l_key | The l key |
key_code.m_key | The m key |
key_code.n_key | The n key |
key_code.o_key | The o key |
key_code.p_key | The p key |
key_code.q_key | The q key |
key_code.r_key | The r key |
key_code.s_key | The s key |
key_code.t_key | The t key |
key_code.u_key | The u key |
key_code.v_key | The v key |
key_code.w_key | The w key |
key_code.x_key | The x key |
key_code.y_key | The y key |
key_code.z_key | The z key |
key_code.delete_key | The delete key |
key_code.keypad_0 | The keypad 0 key |
key_code.keypad_1 | The keypad 1 key |
key_code.keypad_2 | The keypad 2 key |
key_code.keypad_3 | The keypad 3 key |
key_code.keypad_4 | The keypad 4 key |
key_code.keypad_5 | The keypad 5 key |
key_code.keypad_6 | The keypad 6 key |
key_code.keypad_7 | The keypad 7 key |
key_code.keypad_8 | The keypad 8 key |
key_code.keypad_9 | The keypad 9 key |
key_code.keypad_period | The keypad period key |
key_code.keypad_divide | The keypad divide key |
key_code.keypad_multiply | The keypad multiply key |
key_code.keypad_minus | The keypad minus key |
key_code.keypad_plus | The keypad plus key |
key_code.keypad_enter | The keypad enter key |
key_code.keypad_equals | The keypad equals key |
key_code.up_key | The up key |
key_code.down_key | The down key |
key_code.right_key | The right key |
key_code.left_key | The left key |
key_code.insert_key | The insert key |
key_code.home_key | The home key |
key_code.end_key | The end key |
key_code.page_up_key | The page up key |
key_code.page_down_key | The page down key |
key_code.f1_key | The f1 key |
key_code.f2_key | The f2 key |
key_code.f3_key | The f3 key |
key_code.f4_key | The f4 key |
key_code.f5_key | The f5 key |
key_code.f6_key | The f6 key |
key_code.f7_key | The f7 key |
key_code.f8_key | The f8 key |
key_code.f9_key | The f9 key |
key_code.f10_key | The f10 key |
key_code.f11_key | The f11 key |
key_code.f12_key | The f12 key |
key_code.f13_key | The f13 key |
key_code.f14_key | The f14 key |
key_code.f15_key | The f15 key |
key_code.num_lock_key | The num lock key |
key_code.caps_lock_key | The caps lock key |
key_code.scroll_lock_key | The scroll lock key |
key_code.right_shift_key | The right shift key |
key_code.left_shift_key | The left shift key |
key_code.right_ctrl_key | The right ctrl key |
key_code.left_ctrl_key | The left ctrl key |
key_code.right_alt_key | The right alt or option key |
key_code.left_alt_key | The left alt or option key |
key_code.left_super_key | The left super (windows or command) key |
key_code.right_super_key | The right super (windows or command) key |
key_code.mode_key | The mode key |
key_code.help_key | The help key |
key_code.sys_req_key | The sys req key |
key_code.menu_key | The menu key |
key_code.power_key | The power key |
Constant | Description |
---|---|
KeyCode.UnknownKey | The unknown key |
KeyCode.BackspaceKey | The backspace key |
KeyCode.TabKey | The tab key |
KeyCode.ClearKey | The clear key |
KeyCode.ReturnKey | The return key |
KeyCode.PauseKey | The pause key |
KeyCode.EscapeKey | The escape key |
KeyCode.SpaceKey | The space key |
KeyCode.ExclaimKey | The exclaim key |
KeyCode.DoubleQuoteKey | The double quote key |
KeyCode.HashKey | The hash key |
KeyCode.DollarKey | The dollar key |
KeyCode.AmpersandKey | The ampersand key |
KeyCode.QuoteKey | The quote key |
KeyCode.LeftParenKey | The left paren key |
KeyCode.RightParenKey | The right paren key |
KeyCode.AsteriskKey | The asterisk key |
KeyCode.PlusKey | The plus key |
KeyCode.CommaKey | The comma key |
KeyCode.MinusKey | The minus key |
KeyCode.PeriodKey | The period key |
KeyCode.SlashKey | The slash key |
KeyCode.Num0Key | The num 0 key |
KeyCode.Num1Key | The num 1 key |
KeyCode.Num2Key | The num 2 key |
KeyCode.Num3Key | The num 3 key |
KeyCode.Num4Key | The num 4 key |
KeyCode.Num5Key | The num 5 key |
KeyCode.Num6Key | The num 6 key |
KeyCode.Num7Key | The num 7 key |
KeyCode.Num8Key | The num 8 key |
KeyCode.Num9Key | The num 9 key |
KeyCode.ColonKey | The colon key |
KeyCode.SemiColonKey | The semi colon key |
KeyCode.LessKey | The less key |
KeyCode.EqualsKey | The equals key |
KeyCode.GreaterKey | The greater key |
KeyCode.QuestionKey | The question key |
KeyCode.AtKey | The at key |
KeyCode.LeftBracketKey | The left bracket key |
KeyCode.BackslashKey | The backslash () key |
KeyCode.RightBracketKey | The right bracket key |
KeyCode.CaretKey | The caret (^) key |
KeyCode.UnderscoreKey | The underscore (_) key |
KeyCode.BackquoteKey | The backquote (`) key |
KeyCode.AKey | The a key |
KeyCode.BKey | The b key |
KeyCode.CKey | The c key |
KeyCode.DKey | The d key |
KeyCode.EKey | The e key |
KeyCode.FKey | The f key |
KeyCode.GKey | The g key |
KeyCode.HKey | The h key |
KeyCode.IKey | The i key |
KeyCode.JKey | The j key |
KeyCode.KKey | The k key |
KeyCode.LKey | The l key |
KeyCode.MKey | The m key |
KeyCode.NKey | The n key |
KeyCode.OKey | The o key |
KeyCode.PKey | The p key |
KeyCode.QKey | The q key |
KeyCode.RKey | The r key |
KeyCode.SKey | The s key |
KeyCode.TKey | The t key |
KeyCode.UKey | The u key |
KeyCode.VKey | The v key |
KeyCode.WKey | The w key |
KeyCode.XKey | The x key |
KeyCode.YKey | The y key |
KeyCode.ZKey | The z key |
KeyCode.DeleteKey | The delete key |
KeyCode.Keypad0 | The keypad 0 key |
KeyCode.Keypad1 | The keypad 1 key |
KeyCode.Keypad2 | The keypad 2 key |
KeyCode.Keypad3 | The keypad 3 key |
KeyCode.Keypad4 | The keypad 4 key |
KeyCode.Keypad5 | The keypad 5 key |
KeyCode.Keypad6 | The keypad 6 key |
KeyCode.Keypad7 | The keypad 7 key |
KeyCode.Keypad8 | The keypad 8 key |
KeyCode.Keypad9 | The keypad 9 key |
KeyCode.KeypadPeriod | The keypad period key |
KeyCode.KeypadDivide | The keypad divide key |
KeyCode.KeypadMultiply | The keypad multiply key |
KeyCode.KeypadMinus | The keypad minus key |
KeyCode.KeypadPlus | The keypad plus key |
KeyCode.KeypadEnter | The keypad enter key |
KeyCode.KeypadEquals | The keypad equals key |
KeyCode.UpKey | The up key |
KeyCode.DownKey | The down key |
KeyCode.RightKey | The right key |
KeyCode.LeftKey | The left key |
KeyCode.InsertKey | The insert key |
KeyCode.HomeKey | The home key |
KeyCode.EndKey | The end key |
KeyCode.PageUpKey | The page up key |
KeyCode.PageDownKey | The page down key |
KeyCode.F1Key | The f1 key |
KeyCode.F2Key | The f2 key |
KeyCode.F3Key | The f3 key |
KeyCode.F4Key | The f4 key |
KeyCode.F5Key | The f5 key |
KeyCode.F6Key | The f6 key |
KeyCode.F7Key | The f7 key |
KeyCode.F8Key | The f8 key |
KeyCode.F9Key | The f9 key |
KeyCode.F10Key | The f10 key |
KeyCode.F11Key | The f11 key |
KeyCode.F12Key | The f12 key |
KeyCode.F13Key | The f13 key |
KeyCode.F14Key | The f14 key |
KeyCode.F15Key | The f15 key |
KeyCode.NumLockKey | The num lock key |
KeyCode.CapsLockKey | The caps lock key |
KeyCode.ScrollLockKey | The scroll lock key |
KeyCode.RightShiftKey | The right shift key |
KeyCode.LeftShiftKey | The left shift key |
KeyCode.RightCtrlKey | The right ctrl key |
KeyCode.LeftCtrlKey | The left ctrl key |
KeyCode.RightAltKey | The right alt or option key |
KeyCode.LeftAltKey | The left alt or option key |
KeyCode.LeftSuperKey | The left super (windows or command) key |
KeyCode.RightSuperKey | The right super (windows or command) key |
KeyCode.ModeKey | The mode key |
KeyCode.HelpKey | The help key |
KeyCode.SysReqKey | The sys req key |
KeyCode.MenuKey | The menu key |
KeyCode.PowerKey | The power key |
These are the key codes you can use to check details of keyboard actions.
See Key Down
, Key Up
, Key Typed
, and Key Released
functions.
You can get a string representation of these keys using Key Name
.
Mouse Button
Constant | Description |
---|---|
NO_BUTTON | No mouse button |
LEFT_BUTTON | The left mouse button |
MIDDLE_BUTTON | The middle mouse button |
RIGHT_BUTTON | The right mouse button |
MOUSE_X1_BUTTON | The x1 mouse button |
MOUSE_X2_BUTTON | The x2 mouse button |
Constant | Description |
---|---|
MouseButton.NoButton | No mouse button |
MouseButton.LeftButton | The left mouse button |
MouseButton.MiddleButton | The middle mouse button |
MouseButton.RightButton | The right mouse button |
MouseButton.MouseX1Button | The x1 mouse button |
MouseButton.MouseX2Button | The x2 mouse button |
Constant | Description |
---|---|
mouse_button.no_button | No mouse button |
mouse_button.left_button | The left mouse button |
mouse_button.middle_button | The middle mouse button |
mouse_button.right_button | The right mouse button |
mouse_button.mouse_x1_button | The x1 mouse button |
mouse_button.mouse_x2_button | The x2 mouse button |
Constant | Description |
---|---|
MouseButton.NoButton | No mouse button |
MouseButton.LeftButton | The left mouse button |
MouseButton.MiddleButton | The middle mouse button |
MouseButton.RightButton | The right mouse button |
MouseButton.MouseX1Button | The x1 mouse button |
MouseButton.MouseX2Button | The x2 mouse button |
A mouse can have many different types of buttons. Most people know about the simple Left and Right buttons, but there is also a Middle button (sometimes part of a scoll wheel), and possible side buttons.