add click and long_press event

This commit is contained in:
Sheikah
2023-01-27 22:37:42 +08:00
parent 423e3f3571
commit 0b8875b90a
4 changed files with 31 additions and 2 deletions

View File

@@ -5,6 +5,8 @@
#define kp_KEY_UP 0x2
#define kp_ROTATE_LEFT 0x3
#define kp_ROTATE_RIGHT 0x4
#define kp_SHORT_CLICK 0x5
#define kp_LONG_PRESS 0x6
#define kp_KEY1 0x0
#define kp_KEY2 0x1
@@ -17,5 +19,7 @@
#define kp_Type(x) (x & 0b1111)
#define kp_Value(x) (x >> 4)
#define kp_LONG_PRESS_TIMEOUT_MS 250
// query and return keypad event
uint8_t kp_query();