love.keyboard.getScancodeFromKey
Available since LÖVE 0.9.2 |
This function is not supported in earlier versions. |
Gets the hardware scancode corresponding to the given key.
Unlike key constants, Scancodes are keyboard layout-independent: the scancode "w" will be generated if the key in the same place as the "w" key on an American keyboard is pressed, no matter what the key is labelled or what the user's operating system settings are.
Scancodes are useful for creating default controls that have the same physical locations on on all systems.
Function
Synopsis
scancode = love.keyboard.getScancodeFromKey( key )
Arguments
KeyConstant key
- The key to get the scancode from.
Returns
Scancode scancode
- The scancode corresponding to the given key, or "unknown" if the given key has no known physical representation on the current system.
See Also
- love.keyboard
- love.keyboard.getKeyFromScancode
- love.keyboard.isScancodeDown
- love.keypressed
- love.keyreleased
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info