A keyboard device. More...
Public Member Functions | |
KeyboardDevice (System *system) noexcept | |
virtual | ~KeyboardDevice () |
System * | getSystem () const |
virtual bool | isKeyDown (KEY_CODE keyCode)=0 |
virtual void | update ()=0 |
Static Public Member Functions | |
static nkMemory::UniquePtr< KeyboardDevice > | create (System *system=nullptr) |
A keyboard device.
The usual way to use the device is to create it, and update is before checking its state. Typical usage looks like :
|
noexcept |
Constructor.
system | The system to create the device into. |
|
virtual |
Destructor.
System* nkInputs::KeyboardDevice::getSystem | ( | ) | const |
|
pure virtual |
keyCode | the code of the key to check. |
|
pure virtual |
Updates the device.
|
static |
Creates a standalone device, linking it to a system, but no manager. This method can be used to allocate a device and manually manage its lifetime.
system | The system to create the device into. If left to nullptr, then the Singleton instance will be used. |