ChaiLove API  0.28.0
Public Member Functions
love::keyboard Class Reference

Provides an interface to the user's keyboard. More...

Public Member Functions

bool isDown (const std::string &key)
 Checks whether a certain key is down. More...
 
bool isDown (int scancode)
 Checks whether a certain key is down. More...
 
bool isScancodeDown (int scancode)
 Checks whether a certain key is down. More...
 
int getScancodeFromKey (const std::string &key)
 Retrieve a scancode from the given key. More...
 
std::string getKeyFromScancode (int scancode)
 Retrieve a key from the given scancode. More...
 

Detailed Description

Provides an interface to the user's keyboard.

Member Function Documentation

◆ getKeyFromScancode()

std::string love::keyboard::getKeyFromScancode ( int  scancode)

Retrieve a key from the given scancode.

See also
love.keyboard.getScancodeFromKey

◆ getScancodeFromKey()

int love::keyboard::getScancodeFromKey ( const std::string &  key)

Retrieve a scancode from the given key.

See also
love.keyboard.getKeyFromScancode

◆ isDown() [1/2]

bool love::keyboard::isDown ( const std::string &  key)

Checks whether a certain key is down.

Parameters
keyThe key to check.
Returns
True if the key is down, false if not.

◆ isDown() [2/2]

bool love::keyboard::isDown ( int  scancode)

Checks whether a certain key is down.

Parameters
scancodeThe key scancode to check.
Returns
True if the key is down, false if not.

◆ isScancodeDown()

bool love::keyboard::isScancodeDown ( int  scancode)

Checks whether a certain key is down.

Parameters
scancodeThe key scancode to check.
Returns
True if the key is down, false if not.