diff options
Diffstat (limited to 'common/keyboard.h')
| -rwxr-xr-x[-rw-r--r--] | common/keyboard.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/common/keyboard.h b/common/keyboard.h index 51bf67379..2353805e1 100644..100755 --- a/common/keyboard.h +++ b/common/keyboard.h | |||
| @@ -18,15 +18,41 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 18 | #ifndef KEYBOARD_H | 18 | #ifndef KEYBOARD_H |
| 19 | #define KEYBOARD_H | 19 | #define KEYBOARD_H |
| 20 | 20 | ||
| 21 | #include <stdbool.h> | ||
| 21 | #include <stdint.h> | 22 | #include <stdint.h> |
| 22 | 23 | ||
| 23 | 24 | ||
| 24 | #ifdef __cplusplus | 25 | #ifdef __cplusplus |
| 25 | extern "C" { | 26 | extern "C" { |
| 26 | #endif | 27 | #endif |
| 28 | |||
| 29 | typedef struct { | ||
| 30 | uint8_t row; | ||
| 31 | uint8_t col; | ||
| 32 | } key_t; | ||
| 33 | |||
| 34 | typedef struct { | ||
| 35 | key_t key; | ||
| 36 | bool pressed; | ||
| 37 | } keyevent_t; | ||
| 38 | |||
| 39 | typedef struct { | ||
| 40 | keyevent_t event; | ||
| 41 | uint8_t code; | ||
| 42 | uint8_t mods; | ||
| 43 | uint16_t time; | ||
| 44 | } keyrecord_t; | ||
| 45 | |||
| 46 | #define KEYEQ(keya, keyb) (keya.row == keyb.row && keya.col == keyb.col) | ||
| 47 | |||
| 48 | |||
| 49 | extern uint8_t current_layer; | ||
| 50 | extern uint8_t default_layer; | ||
| 51 | |||
| 27 | void keyboard_init(void); | 52 | void keyboard_init(void); |
| 28 | void keyboard_proc(void); | 53 | void keyboard_task(void); |
| 29 | void keyboard_set_leds(uint8_t leds); | 54 | void keyboard_set_leds(uint8_t leds); |
| 55 | |||
| 30 | #ifdef __cplusplus | 56 | #ifdef __cplusplus |
| 31 | } | 57 | } |
| 32 | #endif | 58 | #endif |
