![]() |
Max OS 0.3
|
Interprets the scan codes from the keyboard. More...
#include <keyboard.h>
Public Member Functions | |
| KeyboardInterpreter () | |
| Construct a new Keyboard Interpreter object. | |
| void | on_key_read (bool, const KeyboardState &, KeyCode) |
| Handle the key event. | |
Public Member Functions inherited from MaxOS::common::InputStreamEventHandler< uint8_t > | |
| InputStreamEventHandler () | |
| _______________________________________________TEMPLATES_________________________________________________________________/// | |
| ~InputStreamEventHandler () | |
| Destroys the InputStreamProcessor and disconnects it from all streams. | |
| virtual void | on_stream_read (uint8_t) |
| Called when data is read from a stream (overridden by subclasses) | |
| virtual void | on_end_of_stream (GenericInputStream< uint8_t > *) |
| Called when a stream has finished. Removes the stream from the array of streams. | |
Public Member Functions inherited from MaxOS::common::EventManager< KeyboardEvents > | |
| void | connect_event_handler (EventHandler< KeyboardEvents > *handler) |
| connect an event handler to the event manager if it is not already connected | |
| void | disconnect_event_handler (EventHandler< KeyboardEvents > *handler) |
| disconnect an event handler from the event manager if it is connected | |
| Vector< Event< KeyboardEvents > * > | raise_event (Event< KeyboardEvents > *event) |
| Calls the on_event function of all the event m_handlers connected to the event manager and returns a list of the results. | |
Protected Attributes | |
| KeyboardState | m_keyboard_state |
| The current state of what special keys are pressed on the keyboard. | |
| bool | m_next_is_first_extended_code = false |
| If true, the next code should be interpreted as an extended code (set when receiving 0xE0) | |
| uint8_t | m_extended_scan_code_bytes = 0 |
| How many bytes are left to read for the current extended scan code. | |
| uint16_t | m_extended_code_buffer = 0 |
| The storage for scan codes that take more than one byte. | |
Protected Attributes inherited from MaxOS::common::InputStreamEventHandler< uint8_t > | |
| common::Vector< GenericInputStream< uint8_t > * > | m_generic_input_streams |
| List of streams being observed by this handler. | |
Protected Attributes inherited from MaxOS::common::EventManager< KeyboardEvents > | |
| Vector< EventHandler< KeyboardEvents > * > | m_handlers |
Interprets the scan codes from the keyboard.
Definition at line 289 of file keyboard.h.
| KeyboardInterpreter::KeyboardInterpreter | ( | ) |
Construct a new Keyboard Interpreter object.
Definition at line 128 of file keyboard.cpp.
| void KeyboardInterpreter::on_key_read | ( | bool | released, |
| const KeyboardState & | state, | ||
| KeyCode | key_code | ||
| ) |
Handle the key event.
| released | True if the key was released, false if it was pressed |
| state | The state of the keyboard |
| key_code | The key code of the key |
Definition at line 143 of file keyboard.cpp.
References MaxOS::common::EventManager< KeyboardEvents >::raise_event().
Referenced by MaxOS::drivers::peripherals::KeyboardInterpreterEN_US::on_stream_read().
|
protected |
The storage for scan codes that take more than one byte.
Definition at line 296 of file keyboard.h.
Referenced by MaxOS::drivers::peripherals::KeyboardInterpreterEN_US::on_stream_read().
|
protected |
How many bytes are left to read for the current extended scan code.
Definition at line 295 of file keyboard.h.
Referenced by MaxOS::drivers::peripherals::KeyboardInterpreterEN_US::on_stream_read().
|
protected |
The current state of what special keys are pressed on the keyboard.
Definition at line 292 of file keyboard.h.
Referenced by MaxOS::drivers::peripherals::KeyboardInterpreterEN_US::on_stream_read().
|
protected |
If true, the next code should be interpreted as an extended code (set when receiving 0xE0)
Definition at line 294 of file keyboard.h.
Referenced by MaxOS::drivers::peripherals::KeyboardInterpreterEN_US::on_stream_read().