Difference between revisions of "Keyboard (Chili Framework)"
(→Members) |
|||
Line 7: | Line 7: | ||
==== Type ==== | ==== Type ==== | ||
− | <code>enum Keyboard::Event::Type</code> | + | <code>enum Keyboard::Event::Type</code><br /> |
+ | |||
This represents the different types of events that can be recorded. The options are <code>Press</code>, <code>Release</code>, and <code>Invalid</code>. | This represents the different types of events that can be recorded. The options are <code>Press</code>, <code>Release</code>, and <code>Invalid</code>. | ||
==== IsPress ==== | ==== IsPress ==== | ||
− | <code>bool Keyboard::IsPress() const</code> | + | <code>bool Keyboard::IsPress() const</code><br /> |
+ | |||
Returns <code>true</code> if the event is a press event. | Returns <code>true</code> if the event is a press event. | ||
==== IsRelease ==== | ==== IsRelease ==== | ||
− | <code>bool Keyboard::IsRelease() const</code> | + | <code>bool Keyboard::IsRelease() const</code><br /> |
+ | |||
Returns <code>true</code> if the event is a release event. | Returns <code>true</code> if the event is a release event. | ||
==== IsValid ==== | ==== IsValid ==== | ||
− | <code>bool Keyboard::IsValid() const</code> | + | <code>bool Keyboard::IsValid() const</code><br /> |
+ | |||
Returns <code>true</code> if the event is a valid event (reading from an empty buffer will return an invalid event object). | Returns <code>true</code> if the event is a valid event (reading from an empty buffer will return an invalid event object). | ||
==== GetCode ==== | ==== GetCode ==== | ||
− | <code>char Keyboard::GetCode()</code> | + | <code>char Keyboard::GetCode()</code><br /> |
+ | |||
Gets the virtual key code of the key associated with the Event object. | Gets the virtual key code of the key associated with the Event object. | ||
Revision as of 19:44, 13 July 2016
With Keyboard
, you can get the current state of depressed keys, and you can pop key press and release events out of an Event
queue contained in Keyboard
. You can also turn autorepeat on/off. Whopee. (Note: the kbd
object lives in MainWindow
's belly.)
Contents
Event
class Keyboard::Event
Key press and release events are held in a buffer in the order they occurred. These events are modeled with they're own class because they're precious fucking little snowflakes.
Members
Type
enum Keyboard::Event::Type
This represents the different types of events that can be recorded. The options are Press
, Release
, and Invalid
.
IsPress
bool Keyboard::IsPress() const
Returns true
if the event is a press event.
IsRelease
bool Keyboard::IsRelease() const
Returns true
if the event is a release event.
IsValid
bool Keyboard::IsValid() const
Returns true
if the event is a valid event (reading from an empty buffer will return an invalid event object).
GetCode
char Keyboard::GetCode()
Gets the virtual key code of the key associated with the Event object.
Members
See also
- The Chili Framework