diff options
Diffstat (limited to 'keyboards/ploopyco/mouse/keymaps/uqs/keymap.c')
-rw-r--r-- | keyboards/ploopyco/mouse/keymaps/uqs/keymap.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/keyboards/ploopyco/mouse/keymaps/uqs/keymap.c b/keyboards/ploopyco/mouse/keymaps/uqs/keymap.c new file mode 100644 index 000000000..564dad13d --- /dev/null +++ b/keyboards/ploopyco/mouse/keymaps/uqs/keymap.c | |||
@@ -0,0 +1,36 @@ | |||
1 | // Copyright 2022 Ulrich Spörlein (@uqs) | ||
2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
3 | // vi:et sw=4: | ||
4 | |||
5 | #include QMK_KEYBOARD_H | ||
6 | |||
7 | enum custom_keycodes { | ||
8 | DBL_CLK_NO = SAFE_RANGE, | ||
9 | }; | ||
10 | |||
11 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
12 | switch (keycode) { | ||
13 | // This works fine in xev(1) or a browser, but not in the game where I | ||
14 | // would want it. Maybe need to increase the delay? Also needs to be | ||
15 | // rewritten to use Deferred Execution. | ||
16 | case DBL_CLK_NO: | ||
17 | if (record->event.pressed) { | ||
18 | tap_code(KC_BTN2); | ||
19 | wait_ms(150); | ||
20 | tap_code(KC_BTN2); | ||
21 | wait_ms(300); | ||
22 | tap_code(KC_N); | ||
23 | } | ||
24 | return false; | ||
25 | } | ||
26 | return true; | ||
27 | } | ||
28 | |||
29 | |||
30 | // Layout is: | ||
31 | // left-most, M1, M3, M2, right-most, fwd, back (on side), tiny middle one | ||
32 | |||
33 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
34 | [0] = LAYOUT(KC_E, KC_BTN1, KC_BTN3, KC_BTN2, KC_LSFT, KC_BTN4, KC_BTN5, DF(1)), // shooters | ||
35 | [1] = LAYOUT(KC_1, KC_BTN1, KC_Y, KC_BTN2, DBL_CLK_NO, KC_N, KC_Y, DF(0)), // stardew valley, sword on 1 | ||
36 | }; | ||