openMSX
|
A position (row, column) in a keyboard matrix. More...
#include <UnicodeKeymap.hh>
Public Member Functions | |
constexpr | KeyMatrixPosition ()=default |
Creates an invalid key matrix position, which can be used when a key does not exist on a particular keyboard. | |
constexpr | KeyMatrixPosition (uint8_t rowCol_) |
Creates a key matrix position from a uint8_t: the row is stored in the high nibble, the column is stored in the low nibble. | |
constexpr | KeyMatrixPosition (unsigned row, unsigned col) |
Creates a key matrix position with a given row and column. | |
constexpr bool | isValid () const |
Returns true iff this position is valid. | |
constexpr uint8_t | getRow () const |
Returns the matrix row. | |
constexpr uint8_t | getColumn () const |
Returns the matrix column. | |
constexpr uint8_t | getRowCol () const |
Returns the matrix row and column combined in a single uint8_t: the column is stored in the lower 3 bits, the row is stored in the higher bits. | |
constexpr uint8_t | getMask () const |
Returns a mask with the bit corresponding to this position's column set, all other bits clear. | |
constexpr bool | operator== (const KeyMatrixPosition &) const =default |
Static Public Attributes | |
static constexpr unsigned | NUM_ROWS = 16 |
Rows are in the range [0..NUM_ROWS). | |
static constexpr unsigned | NUM_COLS = 8 |
Columns are in the range [0..NUM_COLS). | |
static constexpr unsigned | NUM_ROWCOL = 1 << 7 |
Combined row and column values are in the range [0..NUM_ROWCOL). | |
A position (row, column) in a keyboard matrix.
Definition at line 21 of file UnicodeKeymap.hh.
|
constexprdefault |
Creates an invalid key matrix position, which can be used when a key does not exist on a particular keyboard.
|
inlineexplicitconstexpr |
Creates a key matrix position from a uint8_t: the row is stored in the high nibble, the column is stored in the low nibble.
Definition at line 40 of file UnicodeKeymap.hh.
|
inlineconstexpr |
Creates a key matrix position with a given row and column.
Definition at line 47 of file UnicodeKeymap.hh.
|
inlineconstexpr |
Returns the matrix column.
Must only be called on valid positions.
Definition at line 72 of file UnicodeKeymap.hh.
References isValid().
Referenced by getMask().
|
inlineconstexpr |
Returns a mask with the bit corresponding to this position's column set, all other bits clear.
Must only be called on valid positions.
Definition at line 90 of file UnicodeKeymap.hh.
References getColumn(), and isValid().
|
inlineconstexpr |
Returns the matrix row.
Must only be called on valid positions.
Definition at line 64 of file UnicodeKeymap.hh.
References isValid().
|
inlineconstexpr |
Returns the matrix row and column combined in a single uint8_t: the column is stored in the lower 3 bits, the row is stored in the higher bits.
Must only be called on valid positions.
Definition at line 81 of file UnicodeKeymap.hh.
References isValid().
Referenced by openmsx::UnicodeKeymap::getRelevantMods().
|
inlineconstexpr |
Returns true iff this position is valid.
Definition at line 57 of file UnicodeKeymap.hh.
Referenced by getColumn(), getMask(), getRow(), getRowCol(), openmsx::UnicodeKeymap::KeyInfo::isValid(), openmsx::UnicodeKeymap::KeyInfo::KeyInfo(), and KeyMatrixPosition().
|
constexprdefault |
|
staticconstexpr |
Columns are in the range [0..NUM_COLS).
Definition at line 28 of file UnicodeKeymap.hh.
Referenced by KeyMatrixPosition().
|
staticconstexpr |
Combined row and column values are in the range [0..NUM_ROWCOL).
Definition at line 30 of file UnicodeKeymap.hh.
|
staticconstexpr |
Rows are in the range [0..NUM_ROWS).
Definition at line 26 of file UnicodeKeymap.hh.
Referenced by openmsx::Keyboard::getKeys(), KeyMatrixPosition(), and openmsx::Keyboard::transferHostKeyMatrix().