|
|
@ -87,17 +87,38 @@ class ErgoDox {
|
|
|
|
void unMaskKey(byte row, byte col);
|
|
|
|
void unMaskKey(byte row, byte col);
|
|
|
|
bool isKeyMasked(byte row, byte col);
|
|
|
|
bool isKeyMasked(byte row, byte col);
|
|
|
|
|
|
|
|
|
|
|
|
/** Key switch state
|
|
|
|
/** Key switch states
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* These two methods return the state of the keyswitch at any given position,
|
|
|
|
* These methods offer a way to peek at the key switch states, for those cases
|
|
|
|
* regardless of which half they are on. This is a hardware-agnostic access to
|
|
|
|
* where we need to deal with the state closest to the hardware. Some methods
|
|
|
|
* the key switch states.
|
|
|
|
* offer a way to check if a key is pressed, others return the number of
|
|
|
|
|
|
|
|
* pressed keys.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Check if a key is pressed at a given position.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param row is the row the key is located at in the matrix.
|
|
|
|
|
|
|
|
* @param col is the column the key is located at in the matrix.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @returns true if the key is pressed, false otherwise.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool isKeyswitchPressed(byte row, byte col);
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Check if a key is pressed at a given position.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param keyIndex is the key index, as calculated by `keyIndex`.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @note Key indexes start at 1, not 0!
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @returns true if the key is pressed, false otherwise.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
bool isKeyswitchPressed(uint8_t keyIndex);
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Check the number of key switches currently pressed.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* The first variant requires a row and a column, the second an index, as
|
|
|
|
* @returns the number of keys pressed.
|
|
|
|
* returned by `keyIndex`.
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
uint8_t getKeyswitchStateAtPosition(byte row, byte col);
|
|
|
|
uint8_t pressedKeyswitchCount();
|
|
|
|
uint8_t getKeyswitchStateAtPosition(uint8_t keyIndex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ErgoDox-specific stuff
|
|
|
|
// ErgoDox-specific stuff
|
|
|
|
void setStatusLED(uint8_t led, bool state = true);
|
|
|
|
void setStatusLED(uint8_t led, bool state = true);
|
|
|
|