Gamedev Framework (gf)  0.12.0
A C++14 framework for 2D games
Public Member Functions | Static Public Member Functions | List of all members
gf::Keyboard Struct Reference

Some keyboard related functions. More...

#include <gf/Keyboard.h>

Public Member Functions

 Keyboard ()=delete
 Deleted constructor. More...
 

Static Public Member Functions

static const char * getScancodeName (Scancode scancode)
 Get the representation of a scancode. More...
 
static Scancode getScancodeFromName (const char *name)
 Get the scancode associated to a name. More...
 
static const char * getKeycodeName (Keycode keycode)
 Get the representation of a keycode. More...
 
static Keycode getKeycodeFromName (const char *name)
 Get the keycode associated to a name. More...
 
static Keycode localize (Scancode scancode)
 Localize a physical key to a logical one. More...
 
static Scancode unlocalize (Keycode keycode)
 Identify the physical key corresponding to a logical one. More...
 

Detailed Description

Some keyboard related functions.

Constructor & Destructor Documentation

◆ Keyboard()

gf::Keyboard::Keyboard ( )
delete

Deleted constructor.

Member Function Documentation

◆ getKeycodeFromName()

static Keycode gf::Keyboard::getKeycodeFromName ( const char *  name)
static

Get the keycode associated to a name.

Parameters
nameThe name of the keycode
Returns
A keycode
See also
getKeycodeName()

◆ getKeycodeName()

static const char* gf::Keyboard::getKeycodeName ( Keycode  keycode)
static

Get the representation of a keycode.

Parameters
keycodeThe keycode
Returns
A string representing the keycode
See also
getKeycodeFromName()

◆ getScancodeFromName()

static Scancode gf::Keyboard::getScancodeFromName ( const char *  name)
static

Get the scancode associated to a name.

Parameters
nameThe name of the scancode
Returns
A scancode
See also
getScancodeName()

◆ getScancodeName()

static const char* gf::Keyboard::getScancodeName ( Scancode  scancode)
static

Get the representation of a scancode.

Parameters
scancodeThe scancode
Returns
A string representing the scancode
See also
getScancodeFromName()

◆ localize()

static Keycode gf::Keyboard::localize ( Scancode  scancode)
static

Localize a physical key to a logical one.

Parameters
scancodeThe scancode to localize
Returns
The keycode corresponding to the scancode under the current keyboard layout used by the operating system, or gf::Keycode::Unknown when the scancode cannot be mapped to a keycode.
See also
unlocalize()

◆ unlocalize()

static Scancode gf::Keyboard::unlocalize ( Keycode  keycode)
static

Identify the physical key corresponding to a logical one.

Parameters
keycodeThe keycode to "unlocalize"
Returns
The scancode corresponding to the key under the current keyboard layout used by the operating system, or gf::Scancode::Unknown when the key cannot be mapped to a scancode.
See also
localize()