25#ifndef SFML_KEYBOARD_HPP
26#define SFML_KEYBOARD_HPP
31#include <SFML/Window/Export.hpp>
165 BackSpace = Backspace,
166 BackSlash = Backslash,
167 SemiColon = Semicolon,
187 #if defined(__clang__)
188 #pragma clang diagnostic push
189 #pragma clang diagnostic ignored "-Wshadow"
351 #if defined(__clang__)
352 #pragma clang diagnostic pop
356 typedef Scan::Scancode Scancode;
Give access to the real-time state of the keyboard.
static Key localize(Scancode code)
Localize a physical key to a logical one.
static bool isKeyPressed(Key key)
Check if a key is pressed.
static bool isKeyPressed(Scancode code)
Check if a key is pressed.
static String getDescription(Scancode code)
Provide a string representation for a given scancode.
@ Numpad1
The numpad 1 key.
@ PageDown
The Page down key.
@ Numpad8
The numpad 8 key.
@ LShift
The left Shift key.
@ RControl
The right Control key.
@ Numpad9
The numpad 9 key.
@ Numpad7
The numpad 7 key.
@ Enter
The Enter/Return keys.
@ Hyphen
The - key (hyphen)
@ RShift
The right Shift key.
@ Numpad4
The numpad 4 key.
@ Subtract
The - key (minus, usually from numpad)
@ LSystem
The left OS specific key: window (Windows and Linux), apple (macOS), ...
@ Numpad2
The numpad 2 key.
@ Numpad5
The numpad 5 key.
@ KeyCount
Keep last – the total number of keyboard keys.
@ Backspace
The Backspace key.
@ Numpad6
The numpad 6 key.
@ Numpad3
The numpad 3 key.
@ RSystem
The right OS specific key: window (Windows and Linux), apple (macOS), ...
@ LControl
The left Control key.
@ Numpad0
The numpad 0 key.
static void setVirtualKeyboardVisible(bool visible)
Show or hide the virtual keyboard.
static Scancode delocalize(Key key)
Identify the physical key corresponding to a logical one.
Utility string class that automatically handles conversions between types and encodings.
@ Backslash
Keyboard \ and | key OR various keys for Non-US keyboards.
@ Comma
Keyboard , and < key.
@ Right
Keyboard Right Arrow key.
@ MediaNextTrack
Keyboard Media Next Track key.
@ PageUp
Keyboard Page Up key.
@ Execute
Keyboard Execute key.
@ Num4
Keyboard 4 and $ key.
@ Num2
Keyboard 2 and @ key.
@ Numpad3
Keypad 3 and Page Down key.
@ Down
Keyboard Down Arrow key.
@ Search
Keyboard Search key.
@ LaunchMediaSelect
Keyboard Launch Media Select key.
@ Refresh
Keyboard Refresh key.
@ Left
Keyboard Left Arrow key.
@ Numpad4
Keypad 4 and Left Arrow key.
@ RAlt
Keyboard Right Alt key.
@ Delete
Keyboard Delete Forward key.
@ Select
Keyboard Select key.
@ Num3
Keyboard 3 and # key.
@ Numpad9
Keypad 9 and Page Up key.
@ Space
Keyboard Space key.
@ PageDown
Keyboard Page Down key.
@ VolumeMute
Keyboard Volume Mute key.
@ Numpad7
Keypad 7 and Home key.
@ LBracket
Keyboard [ and { key.
@ Pause
Keyboard Pause key.
@ MediaPlayPause
Keyboard Media Play Pause key.
@ NonUsBackslash
Keyboard Non-US \ and | key.
@ Numpad2
Keypad 2 and Down Arrow key.
@ Numpad6
Keypad 6 and Right Arrow key.
@ Numpad0
Keypad 0 and Insert key.
@ Application
Keyboard Application key.
@ RBracket
Keyboard ] and } key.
@ NumpadEqual
keypad = key
@ Slash
Keyboard / and ? key.
@ LSystem
Keyboard Left System key.
@ Semicolon
Keyboard ; and : key.
@ NumpadDecimal
Keypad . and Delete key.
@ RSystem
Keyboard Right System key.
@ Backspace
Keyboard Backspace key.
@ CapsLock
Keyboard Caps Lock key.
@ MediaStop
Keyboard Media Stop key.
@ Up
Keyboard Up Arrow key.
@ Num6
Keyboard 6 and ^ key.
@ Numpad8
Keypad 8 and Up Arrow key.
@ LaunchApplication2
Keyboard Launch Application 2 key.
@ Grave
Keyboard ` and ~ key.
@ RShift
Keyboard Right Shift key.
@ PrintScreen
Keyboard Print Screen key.
@ Insert
Keyboard Insert key.
@ HomePage
Keyboard Home Page key.
@ LShift
Keyboard Left Shift key.
@ LAlt
Keyboard Left Alt key.
@ VolumeDown
Keyboard Volume Down key.
@ VolumeUp
Keyboard Volume Up key.
@ LControl
Keyboard Left Control key.
@ Num7
Keyboard 7 and & key.
@ Paste
Keyboard Paste key.
@ RControl
Keyboard Right Control key.
@ LaunchMail
Keyboard Launch Mail key.
@ NumpadPlus
Keypad + key.
@ ScrollLock
Keyboard Scroll Lock key.
@ NumpadMultiply
Keypad * key.
@ Num5
Keyboard 5 and % key.
@ Numpad1
Keypad 1 and End key.
@ LaunchApplication1
Keyboard Launch Application 1 key.
@ MediaPreviousTrack
Keyboard Media Previous Track key.
@ Apostrophe
Keyboard ' and " key.
@ NumpadDivide
Keypad / key.
@ Escape
Keyboard Escape key.
@ NumLock
Keypad Num Lock and Clear key.
@ Favorites
Keyboard Favorites key.
@ NumpadEnter
Keypad Enter/Return key.
@ Enter
Keyboard Enter/Return key.
@ Forward
Keyboard Forward key.
@ Num0
Keyboard 0 and ) key.
@ ModeChange
Keyboard Mode Change key.
@ Num1
Keyboard 1 and ! key.
@ Period
Keyboard . and > key.
@ NumpadMinus
Keypad - key.
@ Hyphen
Keyboard - and _ key.
@ Num8
Keyboard 8 and * key.
@ Num9
Keyboard 9 and ) key.