aboutsummaryrefslogtreecommitdiff
path: root/keyboards/kbdfans
diff options
context:
space:
mode:
authorAaronVerDow <2530548+AaronVerDow@users.noreply.github.com>2021-04-19 04:23:20 -0500
committerGitHub <noreply@github.com>2021-04-19 02:23:20 -0700
commit00eea387fcbd8ec3c37f029594891672f4889720 (patch)
tree65d1087e95ef67d0bb349d75c00f9db9ccf14180 /keyboards/kbdfans
parent2274631c8fd4fb6b20f6dc9e571dfb43625f629e (diff)
downloadqmk_firmware-00eea387fcbd8ec3c37f029594891672f4889720.tar.gz
qmk_firmware-00eea387fcbd8ec3c37f029594891672f4889720.zip
[Keymap] Iracing replay keymap (#12461)
Co-authored-by: Aaron VerDow <aaron@verdow.com>
Diffstat (limited to 'keyboards/kbdfans')
-rw-r--r--keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/keymap.c156
-rw-r--r--keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/readme.md17
-rw-r--r--keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/rules.mk1
3 files changed, 174 insertions, 0 deletions
diff --git a/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/keymap.c b/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/keymap.c
new file mode 100644
index 000000000..39ebb77ff
--- /dev/null
+++ b/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/keymap.c
@@ -0,0 +1,156 @@
1/* Copyright 2021 Aaron VerDow
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18
19// Layer declarations
20enum {
21 DEF_LAYER,
22 MOD_LAYER,
23};
24
25// Tap Dance declarations
26enum {
27 TD_CAR,
28 TD_PRINT,
29 TD_CAM_UP,
30 TD_CAM_DN
31};
32
33void camera_number(uint16_t tens, uint16_t ones) {
34/* Switch to a specific camera number
35 *
36 * I haven't been able to find official docs for this.
37 *
38 * To determine the number click the dropdown in UI and
39 * count from the top. The list can change with updates.
40 *
41 * Shift must be held between both * presses or the combo
42 * won't be recognized.
43 */
44
45 register_code16(KC_LSFT);
46 tap_code(KC_8);
47 tap_code(KC_8);
48 unregister_code16(KC_LSFT);
49 tap_code(tens);
50 tap_code(ones);
51 tap_code(KC_ENT);
52}
53
54void cam_up(qk_tap_dance_state_t *state, void *user_data) {
55 switch (state->count) {
56 case 1:
57 tap_code(KC_C); // tap once for next cam
58 break;
59 case 2:
60 camera_number(KC_2,KC_0); // tap twice for reverse chase cam
61 break;
62 }
63}
64
65void cam_down(qk_tap_dance_state_t *state, void *user_data) {
66 switch (state->count) {
67 case 1:
68 tap_code16(LSFT(KC_C)); // tap once for prev cam
69 break;
70 case 2:
71 camera_number(KC_1,KC_8); // tap twice for chase cam
72 break;
73 }
74}
75
76// Tap Dance definitions
77qk_tap_dance_action_t tap_dance_actions[] = {
78 [TD_CAR] = ACTION_TAP_DANCE_DOUBLE(
79 LSFT(KC_V), // tap once for prev car
80 LCTL(KC_V) // tap twice for my car
81 ),
82 [TD_PRINT] = ACTION_TAP_DANCE_DOUBLE(
83 LCTL(LALT(LSFT(KC_S))), // tap once for iRacing screenshot (must be enabled in options)
84 LGUI(KC_PSCR) // tap twice for Windows print screen and save to file
85 ),
86 [TD_CAM_UP] = ACTION_TAP_DANCE_FN(cam_up),
87 [TD_CAM_DN] = ACTION_TAP_DANCE_FN(cam_down)
88};
89
90const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
91 [DEF_LAYER] = LAYOUT_ortho_6x4( /* Base */
92
93 TD(TD_CAM_UP), // next cam, double tap for reverse chase cam
94 KC_V, // next car
95 LSFT(KC_P3), // next lap
96 LCTL(KC_P3), // next inc
97
98 TD(TD_CAM_DN), // prev cam, double tap for chase cam
99 TD(TD_CAR), // prev car, double tap for my car
100 LSFT(KC_P1), // prev lap
101 LCTL(KC_P1), // prev inc
102
103 LSFT(KC_P4), // rewind
104 KC_P5, // play/pause
105 LSFT(KC_P6), // fast forward
106 KC_P8, // slow mo
107
108 KC_P4, // prev frame
109 KC_W, // up
110 KC_P6, // next frame
111 TD(TD_PRINT), // print screen
112
113 KC_A, // left
114 KC_S, // down
115 KC_D, // right
116 LALT(KC_K), // toggle click and drag ui elements (in car)
117
118 KC_LCTL, // ctrl
119 KC_LALT, // alt
120 LCTL(KC_F12), // camera tool
121 LT(MOD_LAYER, KC_SPACE) // press once for UI, hold for MOD layer
122 ),
123
124 [MOD_LAYER] = LAYOUT_ortho_6x4( /* Base */
125
126 KC_B, // next sub cam
127 KC_PGUP, // next driver cam
128 LCTL(KC_P6), // next session
129 KC_P7, // start
130
131 LSFT(KC_B), // prev sub cam
132 KC_PGDOWN, // prev driver cam
133 LCTL(KC_P4), // prev session
134 KC_P1, // end
135
136 KC_RBRC, // FOV up
137 KC_EQL, // step factor up
138 _______,
139 _______,
140
141 KC_LBRC, // FOV down
142 KC_MINS, // step factor down
143 _______,
144 _______,
145
146 _______,
147 _______,
148 _______,
149 _______,
150
151 _______,
152 LALT(KC_M), // cycle aim
153 RALT(KC_ENTER), // fullscreen (unreliable)
154 _______
155 ),
156};
diff --git a/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/readme.md b/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/readme.md
new file mode 100644
index 000000000..a574499c6
--- /dev/null
+++ b/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/readme.md
@@ -0,0 +1,17 @@
1# iRacing Replay Tool
2
3![](https://imgur.com/0948eBGh.jpg)
4
5Replay/camera tool for iRacing. This uses the default keybindings for the game so nothing should need to be mapped. This makes replays much easier to view in VR and makes waiting through heats a lot more enjoyable.
6
7To make full use of the arrow keys open the camera tool (you can close the UI after) and optionally switch the AIM to static.
8
9The code to generate stl files for the keycap set are ![available here.](https://github.com/AaronVerDow/KeyV2/blob/numpad/src/layouts/numpad/iracing.scad)
10
11Other notes:
12* Hold MOD (UI key) to access features on the front of
13* Double tap car down is a shortcut for your car
14* Double tap cam down is a shortcut for chase cam
15* Double tap cam up is a shortcut for reverse chase cam
16* The record button takes a screenshot using iRacing. Double tap record button to auto save a screenshot using Windows.
17* The key above UI is unassigned
diff --git a/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/rules.mk b/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/rules.mk
new file mode 100644
index 000000000..e5ddcae8d
--- /dev/null
+++ b/keyboards/kbdfans/kbdpad_mk2/keymaps/iracing_replay/rules.mk
@@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes