Skip to content

Commit

Permalink
Document hid::getKeyswitchStateAtPosition
Browse files Browse the repository at this point in the history
Fixes keyboardio/Kaleidoscope-HIDAdaptor-KeyboardioHID#7.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
  • Loading branch information
algernon committed Jun 10, 2018
1 parent a54b139 commit 33e64d5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/kaleidoscope/hid.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,32 @@ extern void sendKeyboardReport();
extern boolean isModifierKeyActive(Key mappedKey);
extern boolean wasModifierKeyActive(Key mappedKey);

/**
* Check the state of a key at a given position.
*
* This is a hardware-agnostic, portable way to peek into the keyswitch states.
* Implemented by the hardware plugins under the hood, we provide a wrapper here
* for user code.
*
* @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 zero if the key is not pressed, non-zero otherwise.
*/
extern uint8_t getKeyswitchStateAtPosition(byte row, byte col);
/**
* Check the state of a key at a given position.
*
* This is a hardware-agnostic, portable way to peek into the keyswitch states.
* Implemented by the hardware plugins under the hood, we provide a wrapper here
* for user code.
*
* @param keyIndex is the key index, as calculated by `keyIndex`.
*
* @note Key indexes start at 1, not 0!
*
* @returns zero if the key is not pressed, non-zero otherwise.
*/
extern uint8_t getKeyswitchStateAtPosition(uint8_t keyIndex);

extern uint8_t getKeyboardLEDs();
Expand Down

0 comments on commit 33e64d5

Please sign in to comment.