mirror of
https://github.com/whowechina/mai_pico.git
synced 2024-11-28 05:20:49 +01:00
Extra buttons working in nkro mode: select/test/service/coin
This commit is contained in:
parent
4d71b7e11d
commit
1d823b8d0f
Binary file not shown.
@ -14,12 +14,12 @@
|
|||||||
#define RGB_ORDER GRB // or RGB
|
#define RGB_ORDER GRB // or RGB
|
||||||
#define RGB_BUTTON_MAP { 5, 4, 3, 2, 1, 0, 7, 6, 8, 9, 10, 11 }
|
#define RGB_BUTTON_MAP { 5, 4, 3, 2, 1, 0, 7, 6, 8, 9, 10, 11 }
|
||||||
|
|
||||||
#define BUTTON_DEF { 1, 0, 4, 5, 8, 9, 3, 2, 12, 10, 11, 13 }
|
#define BUTTON_DEF { 1, 0, 4, 5, 8, 9, 3, 2, 12, 11, 10, 14 }
|
||||||
|
|
||||||
/* HID Keycode: https://github.com/hathach/tinyusb/blob/master/src/class/hid/hid.h */
|
/* HID Keycode: https://github.com/hathach/tinyusb/blob/master/src/class/hid/hid.h */
|
||||||
// P1: WEDCXZAQ34 P2: (Numpad)89632147*-
|
// P1: WEDCXZAQ3(F1)(F2)(F3) P2: (Numpad)89632147*(F1)(F2)(F3)
|
||||||
#define BUTTON_NKRO_MAP_P1 "\x1a\x08\x07\x06\x1b\x1d\x04\x14\x20\x21\x22"
|
#define BUTTON_NKRO_MAP_P1 "\x1a\x08\x07\x06\x1b\x1d\x04\x14\x20\x3a\x3b\x3c"
|
||||||
#define BUTTON_NKRO_MAP_P2 "\x60\x61\x5e\x5b\x5a\x59\x5c\x5f\x55\x56\x57"
|
#define BUTTON_NKRO_MAP_P2 "\x60\x61\x5e\x5b\x5a\x59\x5c\x5f\x55\x3a\x3b\x3c"
|
||||||
|
|
||||||
#define TOUCH_MAP { E3, A2, B2, D2, E2, A1, B1, D1, E1, C2, A8, B8, \
|
#define TOUCH_MAP { E3, A2, B2, D2, E2, A1, B1, D1, E1, C2, A8, B8, \
|
||||||
D8, E8, A7, B7, D7, E7, A6, B6, D6, E6, A5, B5, \
|
D8, E8, A7, B7, D7, E7, A6, B6, D6, E6, A5, B5, \
|
||||||
|
@ -65,7 +65,7 @@ static void gen_nkro_report()
|
|||||||
|
|
||||||
uint16_t buttons = button_read();
|
uint16_t buttons = button_read();
|
||||||
const char *keymap = (mai_cfg->hid.nkro == 2) ? keymap_p2 : keymap_p1;
|
const char *keymap = (mai_cfg->hid.nkro == 2) ? keymap_p2 : keymap_p1;
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < button_num(); i++) {
|
||||||
uint8_t code = keymap[i];
|
uint8_t code = keymap[i];
|
||||||
uint8_t byte = code / 8;
|
uint8_t byte = code / 8;
|
||||||
uint8_t bit = code % 8;
|
uint8_t bit = code % 8;
|
||||||
|
Loading…
Reference in New Issue
Block a user