TSdlKeycode
The SDL virtual key representation.
Values of this type are used to represent keyboard keys using the current layout of the keyboard. These values include Unicode values representing the unmodified character that would be generated by pressing the key, or an TSdlKeycode.* value for those keys that do not generate characters.
A special exception is the number keys at the top of the keyboard which map to TSdlKeycode._0...TSdlKeycode._9 on AZERTY layouts.
Definition
Unit: Neslib.Sdl3.Input
type TSdlKeycode = (Unknown, Return, Escape, Backspace, Tab, Space, Exclaim, DblApostrophe, Hash, Dollar, Percent, Ampersand, Apostrophe, LeftParen, RightParen...)
Enumeration Values
Unknown = SDLK_UNKNOWN
Return = SDLK_RETURN
Escape = SDLK_ESCAPE
Backspace = SDLK_BACKSPACE
Tab = SDLK_TAB
Space = SDLK_SPACE
Exclaim = SDLK_EXCLAIM
DblApostrophe = SDLK_DBLAPOSTROPHE
Hash = SDLK_HASH
Dollar = SDLK_DOLLAR
Percent = SDLK_PERCENT
Ampersand = SDLK_AMPERSAND
Apostrophe = SDLK_APOSTROPHE
LeftParen = SDLK_LEFTPAREN
RightParen = SDLK_RIGHTPAREN
Asterisk = SDLK_ASTERISK
Plus = SDLK_PLUS
Comma = SDLK_COMMA
Minus = SDLK_MINUS
Period = SDLK_PERIOD
Slash = SDLK_SLASH
_0 = SDLK_0
_1 = SDLK_1
_2 = SDLK_2
_3 = SDLK_3
_4 = SDLK_4
_5 = SDLK_5
_6 = SDLK_6
_7 = SDLK_7
_8 = SDLK_8
_9 = SDLK_9
Colon = SDLK_COLON
SemiColon = SDLK_SEMICOLON
Less = SDLK_LESS
Equals = SDLK_EQUALS
Greater = SDLK_GREATER
Question = SDLK_QUESTION
At = SDLK_AT
LeftBracket = SDLK_LEFTBRACKET
Backslash = SDLK_BACKSLASH
RightBracket = SDLK_RIGHTBRACKET
Caret = SDLK_CARET
Underscore = SDLK_UNDERSCORE
Grave = SDLK_GRAVE
A = SDLK_A
B = SDLK_B
C = SDLK_C
D = SDLK_D
E = SDLK_E
F = SDLK_F
G = SDLK_G
H = SDLK_H
I = SDLK_I
J = SDLK_J
K = SDLK_K
L = SDLK_L
M = SDLK_M
N = SDLK_N
O = SDLK_O
P = SDLK_P
Q = SDLK_Q
R = SDLK_R
S = SDLK_S
T = SDLK_T
U = SDLK_U
V = SDLK_V
W = SDLK_W
X = SDLK_X
Y = SDLK_Y
Z = SDLK_Z
LeftBrace = SDLK_LEFTBRACE
Pipe = SDLK_PIPE
RightBrace = SDLK_RIGHTBRACE
Tilde = SDLK_TILDE
Delete = SDLK_DELETE
PlusMinus = SDLK_PLUSMINUS
CapsLock = SDLK_CAPSLOCK
F1 = SDLK_F1
F2 = SDLK_F2
F3 = SDLK_F3
F4 = SDLK_F4
F5 = SDLK_F5
F6 = SDLK_F6
F7 = SDLK_F7
F8 = SDLK_F8
F9 = SDLK_F9
F10 = SDLK_F10
F11 = SDLK_F11
F12 = SDLK_F12
PrintScreen = SDLK_PRINTSCREEN
ScrollLock = SDLK_SCROLLLOCK
Pause = SDLK_PAUSE
Insert = SDLK_INSERT
Home = SDLK_HOME
PageUp = SDLK_PAGEUP
&End = SDLK_END
PageDown = SDLK_PAGEDOWN
Right = SDLK_RIGHT
Left = SDLK_LEFT
Down = SDLK_DOWN
Up = SDLK_UP
NumLockClear = SDLK_NUMLOCKCLEAR
KPDivide = SDLK_KP_DIVIDE
KPMultiply = SDLK_KP_MULTIPLY
KPMinus = SDLK_KP_MINUS
KPPlus = SDLK_KP_PLUS
KPEnter = SDLK_KP_ENTER
KP1 = SDLK_KP_1
KP2 = SDLK_KP_2
KP3 = SDLK_KP_3
KP4 = SDLK_KP_4
KP5 = SDLK_KP_5
KP6 = SDLK_KP_6
KP7 = SDLK_KP_7
KP8 = SDLK_KP_8
KP9 = SDLK_KP_9
KP0 = SDLK_KP_0
KPPeriod = SDLK_KP_PERIOD
Application = SDLK_APPLICATION
Power = SDLK_POWER
KPEquals = SDLK_KP_EQUALS
F13 = SDLK_F13
F14 = SDLK_F14
F15 = SDLK_F15
F16 = SDLK_F16
F17 = SDLK_F17
F18 = SDLK_F18
F19 = SDLK_F19
F20 = SDLK_F20
F21 = SDLK_F21
F22 = SDLK_F22
F23 = SDLK_F23
F24 = SDLK_F24
Execute = SDLK_EXECUTE
Help = SDLK_HELP
Menu = SDLK_MENU
Select = SDLK_SELECT
Stop = SDLK_STOP
Again = SDLK_AGAIN
Undo = SDLK_UNDO
Cut = SDLK_CUT
Copy = SDLK_COPY
Paste = SDLK_PASTE
Find = SDLK_FIND
Mute = SDLK_MUTE
VolumeUp = SDLK_VOLUMEUP
VolumeDown = SDLK_VOLUMEDOWN
KPComma = SDLK_KP_COMMA
KPEqualsAS400 = SDLK_KP_EQUALSAS400
AltErase = SDLK_ALTERASE
SysReq = SDLK_SYSREQ
Cancel = SDLK_CANCEL
Clear = SDLK_CLEAR
Prior = SDLK_PRIOR
Return2 = SDLK_RETURN2
Separator = SDLK_SEPARATOR
&Out = SDLK_OUT
Oper = SDLK_OPER
ClearAgain = SDLK_CLEARAGAIN
CRSel = SDLK_CRSEL
EXSel = SDLK_EXSEL
KP00 = SDLK_KP_00
KP000 = SDLK_KP_000
ThousandsSeparator = SDLK_THOUSANDSSEPARATOR
DecimalSeparator = SDLK_DECIMALSEPARATOR
CurrencyUnit = SDLK_CURRENCYUNIT
CurrencySubUnit = SDLK_CURRENCYSUBUNIT
KPLeftParen = SDLK_KP_LEFTPAREN
KPRightParen = SDLK_KP_RIGHTPAREN
KPLeftBrace = SDLK_KP_LEFTBRACE
KPRightBrace = SDLK_KP_RIGHTBRACE
KPTab = SDLK_KP_TAB
KPBackspace = SDLK_KP_BACKSPACE
KPA = SDLK_KP_A
KPB = SDLK_KP_B
KPC = SDLK_KP_C
KPD = SDLK_KP_D
KPE = SDLK_KP_E
KPF = SDLK_KP_F
KPXor = SDLK_KP_XOR
KPPower = SDLK_KP_POWER
KPPercent = SDLK_KP_PERCENT
KPLess = SDLK_KP_LESS
KPGreater = SDLK_KP_GREATER
KPAmpersand = SDLK_KP_AMPERSAND
KPDblAmpersand = SDLK_KP_DBLAMPERSAND
KPVerticalBar = SDLK_KP_VERTICALBAR
KPDblVerticalBar = SDLK_KP_DBLVERTICALBAR
KPColon = SDLK_KP_COLON
KPHash = SDLK_KP_HASH
KPSpace = SDLK_KP_SPACE
KPAt = SDLK_KP_AT
KPExclam = SDLK_KP_EXCLAM
KPMemStore = SDLK_KP_MEMSTORE
KPMemRecall = SDLK_KP_MEMRECALL
KPMemClear = SDLK_KP_MEMCLEAR
KPMemAdd = SDLK_KP_MEMADD
KPMemSubtract = SDLK_KP_MEMSUBTRACT
KPMemMultiply = SDLK_KP_MEMMULTIPLY
KPMemDivide = SDLK_KP_MEMDIVIDE
KPPlusMinus = SDLK_KP_PLUSMINUS
KPClear = SDLK_KP_CLEAR
KPClearEntry = SDLK_KP_CLEARENTRY
KPBinary = SDLK_KP_BINARY
KP_OCTAL = SDLK_KP_OCTAL
KP_DECIMAL = SDLK_KP_DECIMAL
KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL
LCtrl = SDLK_LCTRL
LShift = SDLK_LSHIFT
LAlt = SDLK_LALT
LGui = SDLK_LGUI
RCtrl = SDLK_RCTRL
RShift = SDLK_RSHIFT
RAlt = SDLK_RALT
RGui = SDLK_RGUI
Mode = SDLK_MODE
Sleep = SDLK_SLEEP
Wake = SDLK_WAKE
ChannelIncremenet = SDLK_CHANNEL_INCREMENT
ChannelDecremenet = SDLK_CHANNEL_DECREMENT
MediaPlay = SDLK_MEDIA_PLAY
MediaPause = SDLK_MEDIA_PAUSE
MediaRecord = SDLK_MEDIA_RECORD
MediaFastForward = SDLK_MEDIA_FAST_FORWARD
MediaRewind = SDLK_MEDIA_REWIND
MediaNextTrack = SDLK_MEDIA_NEXT_TRACK
MediaPreviousTrack = SDLK_MEDIA_PREVIOUS_TRACK
MediaStop = SDLK_MEDIA_STOP
MediaEject = SDLK_MEDIA_EJECT
MediaPlayPause = SDLK_MEDIA_PLAY_PAUSE
MediaSelect = SDLK_MEDIA_SELECT
ACNew = SDLK_AC_NEW
ACOpen = SDLK_AC_OPEN
ACClose = SDLK_AC_CLOSE
ACExit = SDLK_AC_EXIT
ACSave = SDLK_AC_SAVE
ACPrint = SDLK_AC_PRINT
ACProperties = SDLK_AC_PROPERTIES
ACSearch = SDLK_AC_SEARCH
ACHome = SDLK_AC_HOME
ACBack = SDLK_AC_BACK
ACForward = SDLK_AC_FORWARD
ACStop = SDLK_AC_STOP
ACRefresh = SDLK_AC_REFRESH
ACBookmarks = SDLK_AC_BOOKMARKS
SoftLeft = SDLK_SOFTLEFT
SoftRight = SDLK_SOFTRIGHT
Call = SDLK_CALL
EndCall = SDLK_ENDCALL
LeftTab = SDLK_LEFT_TAB
Level5Shift = SDLK_LEVEL5_SHIFT
MultiKeyCompose = SDLK_MULTI_KEY_COMPOSE
LMeta = SDLK_LMETA
RMeta = SDLK_RMETA
LHyper = SDLK_LHYPER
RHyper = SDLK_RHYPER
Properties
Name | Description |
---|---|
Name | A human-readable name for the key. |
Methods
Name | Description |
---|---|
FromName | Get a keycode from a human-readable name. |
FromScancode(TSdlScancode) | Creates a TSdlKeycode from a TSdlScancode. |
FromScancode(TSdlScancode, TSdlKeymods, Boolean) | Get the key code corresponding to the given scancode according to the current keyboard layout. |
ToScancode | Get the scancode corresponding to this key code according to the current keyboard layout. |
ToScancode(TSdlKeyMods) | Get the scancode corresponding to this key code according to the current keyboard layout. |
Property Descriptions
Name
A human-readable name for the key.
If the key doesn't have a name, this property returns an empty string.
Letters will be presented in their uppercase form, if applicable.
property Name: String read GetName
Type: String
See Also
Remarks
This property is not thread safe.
Method Descriptions
FromName(String)
Get a keycode from a human-readable name.
class function FromName(const AName: String): TSdlKeycode; inline; static
Parameters
AName
: String
: The human-readable key name.
Returns
TSdlKeycode
: The keycode, or TSdlKeycode.Unknown
if the name wasn't recognized.
See Also
Remarks
This method is not thread safe.
FromScancode(TSdlScancode)
Creates a TSdlKeycode from a TSdlScancode.
class function FromScancode(const AScancode: TSdlScancode): TSdlKeycode; overload; inline; static
Parameters
AScancode
: TSdlScancode
: The scan code to convert.
Returns
TSdlKeycode
: The keycode for this scancode.
FromScancode(TSdlScancode, TSdlKeymods, Boolean)
Get the key code corresponding to the given scancode according to the current keyboard layout.
If you want to get the keycode as it would be delivered in key events, including options specified in TSdlHints.KeycodeOptions, then you should pass AKeyEvent
as True. Otherwise this function simply translates the scancode based on the given modifier state.
class function FromScancode(const AScancode: TSdlScancode; const AModState: TSdlKeymods; const AKeyEvent: Boolean): TSdlKeycode; overload; inline; static
Parameters
AScancode
: TSdlScancode
: The desired scancode to query.
AModState
: TSdlKeymods
: The modifier state to use when translating the scancode to a keycode.
AKeyEvent
: Boolean
: True if the keycode will be used in key events.
Returns
TSdlKeycode
: The keycode that corresponds to the given scancode.
See Also
Remarks
This method is not thread safe.
ToScancode
Get the scancode corresponding to this key code according to the current keyboard layout.
function ToScancode: TSdlScancode; overload; inline
Returns
TSdlScancode
: The scancode that corresponds to the given keycode.
See Also
Remarks
This method is not thread safe.
ToScancode(TSdlKeyMods)
Get the scancode corresponding to this key code according to the current keyboard layout.
Note that there may be multiple scancode+modifier states that can generate this keycode, this will just return the first one found.
function ToScancode(const AModState: TSdlKeyMods): TSdlScancode; overload; inline
Parameters
AModState
: TSdlKeyMods
: The modifier state that would be used when the scancode generates this key.
Returns
TSdlScancode
: The scancode that corresponds to the given keycode.
See Also
Remarks
This method is not thread safe.