Keyboard object

The Keyboard object represents the current state of the keyboard. There is always one and only Keyboard object available. It's accessible via the Game.Keyboard attribute. For the convenience the templates automatically store the keyboard object in a global variable named Keboard.


Методы

IsKeyDown Queries whether a specified key is pressed.

Атрибуты

Type (только для чтения) Returns always "keyboard"
Key (только для чтения) Returns a string with the name of the pressed key (if the key is a printable character)
Printable (только для чтения) Returns true if the pressed key is a printable character
KeyCode (только для чтения) Returns a numeric code of a pressed key.
IsShift (только для чтения) Returns true if the SHIFT key has been hold down when the key was pressed
IsAlt (только для чтения) Returns true if the ALT key has been hold down when the key was pressed
IsControl (только для чтения) Returns true if the CONTROL key has been hold down when the key was pressed

IsKeyDown(Key)

Queries whether a specified key is pressed.

Параметры

Key
The key to be querried (either a string, such as "A", or a numeric constant)

Возвращаемое значение

Returns true if the key is pressed down.

Примечания

The available key names are defined as constants in the "scripts\keys.inc" file