aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeepeetee <43021794+peepeetee@users.noreply.github.com>2021-05-10 19:32:26 -0500
committerGitHub <noreply@github.com>2021-05-10 17:32:26 -0700
commit77875e89eca07b2681ead5759d6e635823b24895 (patch)
treedbdb87302e3a6a8811774458b52f5ed7710615e0
parent1ab2167ff90ac9de6e21d20e226881699bc385ef (diff)
downloadqmk_firmware-77875e89eca07b2681ead5759d6e635823b24895.tar.gz
qmk_firmware-77875e89eca07b2681ead5759d6e635823b24895.zip
peepeetee's custom keymap for bm68rgb (#12232)
* add custom keymaps for BM68rgb * add user keymap for bm68rgb * fix grammar * add custom hub16 keymap * Apply suggestions from code review * fix errorenously included hub16 file * add GPL headers * revert defining dfa_state in keymap.h * Update keyboards/bm68rgb/keymaps/peepeetee/keymap.h * enable tap dance, add tap dance to left alt
-rw-r--r--keyboards/bm68rgb/keymaps/peepeetee/config.h132
-rw-r--r--keyboards/bm68rgb/keymaps/peepeetee/keymap.c303
-rw-r--r--keyboards/bm68rgb/keymaps/peepeetee/keymap.h63
-rw-r--r--keyboards/bm68rgb/keymaps/peepeetee/readme.md1
4 files changed, 499 insertions, 0 deletions
diff --git a/keyboards/bm68rgb/keymaps/peepeetee/config.h b/keyboards/bm68rgb/keymaps/peepeetee/config.h
new file mode 100644
index 000000000..53eebce7f
--- /dev/null
+++ b/keyboards/bm68rgb/keymaps/peepeetee/config.h
@@ -0,0 +1,132 @@
1/* Copyright 2021 peepeetee
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#pragma once
17
18
19// #define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT)
20// #define MODS_CTRL (get_mods() & MOD_MASK_CTRL)
21// #define MODS_ALT (get_mods() & MOD_MASK_ALT)
22
23// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT) // Key combination that allows the use of magic commands (useful for debugging)
24
25// #define NO_DEBUG // Disable debugging
26// #define NO_PRINT // Disable printing/debugging using hid_listen
27// #define NO_ACTION_LAYER // Disable layers
28// #define NO_ACTION_TAPPING // Disable tap dance and other tapping features
29// #define NO_ACTION_ONESHOT // Disable one-shot modifiers
30// #define NO_ACTION_MACRO // Disable old style macro handling: MACRO() & action_get_macro
31// #define TERMINAL_HELP
32// #define MOUSEKEY_INTERVAL 20
33// #define MOUSEKEY_DELAY 0
34// #define MOUSEKEY_TIME_TO_MAX 60
35// #define MOUSEKEY_MAX_SPEED 10
36// #define MOUSEKEY_WHEEL_DELAY 0
37#define FORCE_NKRO // NKRO by default requires to be turned on, this forces it on during keyboard startup regardless of EEPROM setting. NKRO can still be turned off but will be turned on again if the keyboard reboots.
38// #define QMK_KEYS_PER_SCAN 4 // Allows sending more than one key per scan. By default, only one key event gets sent via process_record() per scan. This has little impact on most typing, but if you're doing a lot of chords, or your scan rate is slow to begin with, you can have some delay in processing key events. Each press and release is a separate event. For a keyboard with 1ms or so scan times, even a very fast typist isn't going to produce the 500 keystrokes a second needed to actually get more than a few ms of delay from this. But if you're doing chording on something with 3-4ms scan times? You probably want this.
39// #define STRICT_LAYER_RELEASE // Force a key release to be evaluated using the current layer stack instead of remembering which layer it came from (used for advanced cases)
40// #define LOCKING_SUPPORT_ENABLE // Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
41// #define LOCKING_RESYNC_ENABLE // Tries to keep switch state consistent with keyboard LED state
42 #define TAPPING_TERM 200 // How long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too
43// #define TAPPING_TERM_PER_KEY // Enables handling for per key TAPPING_TERM settings
44// #define RETRO_TAPPING // Tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
45// #define TAPPING_TOGGLE 2 // How many taps before triggering the toggle
46// #define PERMISSIVE_HOLD // Makes tap and hold keys trigger the hold if another key is pressed before releasing, even if it hasn't hit the TAPPING_TERM. See Permissive Hold for details
47// #define IGNORE_MOD_TAP_INTERRUPT // Makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the TAPPING_TERM for both keys. See Mod tap interrupt for details
48// #define TAPPING_FORCE_HOLD // Makes it possible to use a dual role key as modifier shortly after having been tapped. See Hold after tap. Breaks any Tap Toggle functionality (TT or the One Shot Tap Toggle)
49// #define LEADER_TIMEOUT 300 // How long before the leader key times out. If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the LEADER_PER_KEY_TIMING option, which resets the timeout after each key is tapped.
50// #define LEADER_PER_KEY_TIMING // Sets the timer for leader key chords to run on each key press rather than overall
51// #define LEADER_KEY_STRICT_KEY_PROCESSING // Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify MT(MOD_CTL, KC_A) if you want to use KC_A.
52// #define ONESHOT_TIMEOUT 300 // How long before oneshot times out
53// #define ONESHOT_TAP_TOGGLE 2 // How many taps before oneshot toggle is triggered
54// #define COMBO_COUNT 2 // Set this to the number of combos that you're using in the Combo feature.
55// #define COMBO_TERM 200 // How long for the Combo keys to be detected. Defaults to TAPPING_TERM if not defined.
56// #define TAP_CODE_DELAY 100 // Sets the delay between register_code and unregister_code, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds.
57// #define TAP_HOLD_CAPS_DELAY 80 // Sets the delay for Tap Hold keys (LT, MT) when using KC_CAPSLOCK keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher.
58
59#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
60#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
61// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
62#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_ALPHAS_MODS // Sets the default mode, if none has been set
63// #define RGBLIGHT_HUE_STEP 12 // Units to step when in/decreasing hue
64// #define RGBLIGHT_SAT_STEP 25 // Units to step when in/decreasing saturation
65// #define RGBLIGHT_VAL_STEP 12 // Units to step when in/decreasing value (brightness)
66// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
67// #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
68// #define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
69// #define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
70// #define RGBLIGHT_ANIMATIONS // Run RGB animations
71// #define RGBLIGHT_ANIMATIONS // Enable all additional animation modes.
72// #define RGBLIGHT_EFFECT_ALTERNATING // Enable alternating animation mode.
73// #define RGBLIGHT_EFFECT_BREATHING // Enable breathing animation mode.
74// #define RGBLIGHT_EFFECT_CHRISTMAS // Enable christmas animation mode.
75// #define RGBLIGHT_EFFECT_KNIGHT // Enable knight animation mode.
76// #define RGBLIGHT_EFFECT_RAINBOW_MOOD // Enable rainbow mood animation mode.
77// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL // Enable rainbow swirl animation mode.
78// #define RGBLIGHT_EFFECT_RGB_TEST // Enable RGB test animation mode.
79// #define RGBLIGHT_EFFECT_SNAKE // Enable snake animation mode.
80// #define RGBLIGHT_EFFECT_STATIC_GRADIENT // Enable static gradient mode.
81
82// #define RGBLIGHT_EFFECT_BREATHE_CENTER // If defined, used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7
83// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // The maximum brightness for the breathing mode. Valid values are 1 to 255
84// #define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000 // How long to wait between light changes for the "Christmas" animation, in milliseconds
85// #define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2 // The number of LEDs to group the red/green colors by for the "Christmas" animation
86// #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM // The number of LEDs to have the "Knight" animation travel
87// #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 // The number of LEDs to light up for the "Knight" animation
88// #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 // The number of LEDs to start the "Knight" animation from the start of the strip by
89// #define RGBLIGHT_RAINBOW_SWIRL_RANGE 255 // Range adjustment for the rainbow swirl effect to get different swirls
90// #define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // The number of LEDs to light up for the "Snake" animation
91
92// This list in in the correct mode order. Next mode is the following line, previous mode is previous line. Loops around.
93// #define DISABLE_RGB_MATRIX_SOLID_COLOR // Static single hue, no speed support
94// #define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue, speed is hue for secondary hue
95#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom, speed controls how much gradient changes
96#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT // Static gradient top to bottom, speed controls how much gradient changes
97#define DISABLE_RGB_MATRIX_BREATHING // Single hue brightness cycling animation
98#define DISABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right
99#define DISABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right
100#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation
101#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness
102#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades saturation
103#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness
104#define DISABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard solid hue cycling through full gradient
105//#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient scrolling left to right
106#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom
107#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradent Chevron shapped scrolling left to right
108#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN // Full gradient scrolling out to in
109#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Full dual gradients scrolling out to in
110#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL // Full gradient spinning pinwheel around center of keyboard
111#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard
112#define DISABLE_RGB_MATRIX_DUAL_BEACON // Full gradient spinning around center of keyboard
113#define DISABLE_RGB_MATRIX_RAINBOW_BEACON // Full tighter gradient spinning around center of keyboard
114#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Full dual gradients spinning two halfs of keyboard
115 #define DISABLE_RGB_MATRIX_RAINDROPS // Randomly changes a single key's hue
116 #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Randomly changes a single key's hue and saturation
117// =================================================== Requires RGB_MATRIX_FRAMEBUFFER_EFFECTS =============================================================
118// #define DISABLE_RGB_MATRIX_TYPING_HEATMAP // How hot is your WPM!
119#define DISABLE_RGB_MATRIX_DIGITAL_RAIN // That famous computer simulation
120// =================================================== RGB_MATRIX_KEYPRESSES OR RGB_MATRIX_KEYRELEASES =====================================================
121 #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Pulses keys hit to hue & value then fades value out
122#define DISABLE_RGB_MATRIX_SOLID_REACTIVE // Static single hue, pulses keys hit to shifted hue then fades to current hue
123#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
124#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out
125#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out
126#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out
127#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out
128#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out
129#define DISABLE_RGB_MATRIX_SPLASH // Full gradient & value pulse away from a single key hit then fades value out
130#define DISABLE_RGB_MATRIX_MULTISPLASH // Full gradient & value pulse away from multiple key hits then fades value out
131#define DISABLE_RGB_MATRIX_SOLID_SPLASH // Hue & value pulse away from a single key hit then fades value out
132#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH // Hue & value pulse away from multiple key hits then fades value out
diff --git a/keyboards/bm68rgb/keymaps/peepeetee/keymap.c b/keyboards/bm68rgb/keymaps/peepeetee/keymap.c
new file mode 100644
index 000000000..934463b11
--- /dev/null
+++ b/keyboards/bm68rgb/keymaps/peepeetee/keymap.c
@@ -0,0 +1,303 @@
1/* Copyright 2019 ash0x0 2021 peepeetee
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#include QMK_KEYBOARD_H
17#include "keymap.h"
18// // Defines names for use in layer keycodes and the keymap
19// enum layer_names {
20// _BASE,
21// _FN
22// };
23
24
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27 [0] = LAYOUT_65_ansi(
28 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,
29 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
30 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDOWN,
31 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
32 KC_LCTL, KC_LGUI,LT(1, KC_LALT), KC_SPC, KC_RALT, MO(1),KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT
33 ),
34 [1] = LAYOUT_65_ansi(
35 KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DELETE,
36 RGB_MOD, RGB_HUI, RGB_VAI, RGB_SAI, RGB_SPI, _______, KC_KP_7, KC_KP_8, KC_KP_9, _______, _______, _______, _______, _______, KC_PGUP,
37 RGB_TOG, RGB_HUD, RGB_VAD, RGB_SAD, RGB_SPD, _______, KC_KP_4, KC_KP_5, KC_KP_6, _______, _______, _______, _______, KC_PGDOWN,
38 BL_TOGG, _______, _______, _______, _______, RESET, KC_KP_1, KC_KP_2, KC_KP_3, _______, _______, _______, KC_AUDIO_VOL_UP, KC_END,
39 _______, _______, _______, _______, _______, _______, _______, KC_BRIGHTNESS_DOWN, KC_AUDIO_VOL_DOWN, KC_BRIGHTNESS_UP
40 ),
41
42};
43
44/*
45Templete
46 [ ] = LAYOUT_65_ansi(
47 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
48 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
50 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
51 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
52 ),
53*/
54
55#ifdef _______
56#undef _______
57#define _______ {0, 0, 0}
58
59const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
60 [1] = {
61 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
62 GREEN, BLUE, {0, 0, 255}, PURPLE, AZURE, _______, {0, 0, 255}, {0, 0, 255}, {0, 0, 255}, _______, _______, _______, _______, _______, _______,
63 RED, BLUE, {0, 0, 1}, PURPLE, AZURE, _______, {0, 0, 255}, {0, 0, 255}, {0, 0, 255}, _______, _______, _______, _______, _______,
64 _______, _______, _______, _______, _______, RED, {0, 0, 255}, {0, 0, 255}, {0, 0, 255}, _______, _______, _______, _______, _______,
65 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
66 }
67
68};
69
70#undef _______
71#define _______ KC_TRNS
72#endif
73
74
75
76void keyboard_post_init_user(void) {
77 // Call the post init code.
78 dfa_state = 0; // ENGLISH
79}
80
81
82
83bool process_record_user(uint16_t keycode, keyrecord_t *record) {
84 switch (keycode) {
85 case KC_DELETE:
86 if (record->event.pressed) {
87 dfa_state = 0;
88 } else {
89 // Do something else when release
90 }
91 return false; // Skip all further processing of this key
92 case KC_SPC:
93 if (record->event.pressed) {
94 if ((get_mods() & MOD_BIT(KC_LGUI)) == MOD_BIT(KC_LGUI)){
95 if(dfa_state == 3){
96 dfa_state = 0;
97 } else {
98 dfa_state = dfa_state + 1;
99 }
100 }
101 } else {
102 // Do something else when release
103 }
104 return true; // Continue execution
105
106
107 case KC_HOME:
108 if (record->event.pressed) {
109 switch(dfa_state){
110 case 0 :{
111 return false;
112 }
113 case 1 :{
114 tap_code16(G(KC_SPC));
115 wait_ms(100);
116 tap_code16(G(KC_SPC));
117 wait_ms(100);
118 tap_code16(G(KC_SPC));
119 dfa_state = 0;
120 return false;
121 }
122 case 2 :{
123 tap_code16(G(KC_SPC));
124 wait_ms(100);
125 tap_code16(G(KC_SPC));
126 dfa_state = 0;
127 return false;
128 }
129 case 3 :{
130 tap_code16(G(KC_SPC));
131 dfa_state = 0;
132 return false;
133 }
134 }
135
136 // Do something when pressed
137 } else {
138 // Do something else when release
139 }
140 return false; // Skip all further processing of this key
141 // case KC_PGUP:
142 // if (record->event.pressed) {
143 // switch(dfa_state){
144 // case 0 :{
145 // tap_code16(G(KC_SPC));
146 // dfa_state = 1;
147 // return false;
148 // }
149 // case 1 :{
150 // return false;
151 // }
152 // case 2 :{
153 // tap_code16(G(KC_SPC));
154 // wait_ms(100);
155 // tap_code16(G(KC_SPC));
156 // wait_ms(100);
157 // tap_code16(G(KC_SPC));
158 // dfa_state = 1;
159 // return false;
160 // }
161 // case 3 :{
162 // tap_code16(G(KC_SPC));
163 // wait_ms(100);
164 // tap_code16(G(KC_SPC));
165 // dfa_state = 1;
166 // return false;
167 // }
168 // }
169 // // Do something when pressed
170 // } else {
171 // // Do something else when release
172 // }
173 // return false; // Skip all further processing of this key
174 // case KC_PGDOWN:
175 // if (record->event.pressed) {
176 // switch(dfa_state){
177 // case 0 :{
178 // tap_code16(G(KC_SPC));
179 // wait_ms(100);
180 // tap_code16(G(KC_SPC));
181 // dfa_state = 2;
182 // return false;
183 // }
184 // case 1 :{
185 // tap_code16(G(KC_SPC));
186 // dfa_state = 2;
187 // return false;
188 // }
189 // case 2 :{
190 // return false;
191 // }
192 // case 3 :{
193 // tap_code16(G(KC_SPC));
194 // wait_ms(100);
195 // tap_code16(G(KC_SPC));
196 // wait_ms(100);
197 // tap_code16(G(KC_SPC));
198 // dfa_state = 2;
199 // return false;
200 // }
201 // }
202 // // Do something when pressed
203 // } else {
204 // // Do something else when release
205 // }
206 // return false; // Skip all further processing of this key
207 // case KC_END:
208 // if (record->event.pressed) {
209 // switch(dfa_state){
210 // case 0 :{
211 // tap_code16(G(KC_SPC));
212 // wait_ms(100);
213 // tap_code16(G(KC_SPC));
214 // wait_ms(100);
215 // tap_code16(G(KC_SPC));
216 // dfa_state = 3;
217 // return false;
218 // }
219 // case 1 :{
220 // tap_code16(G(KC_SPC));
221 // wait_ms(100);
222 // tap_code16(G(KC_SPC));
223 // dfa_state = 3;
224 // return false;
225 // }
226 // case 2 :{
227 // tap_code16(G(KC_SPC));
228 // dfa_state = 3;
229 // return false;
230 // }
231 // case 3 :{
232 // return false;
233 // }
234 // }
235 // // Do something when pressed
236 // } else {
237 // // Do something else when release
238 // }
239 // return false; // Skip all further processing of this key
240 case RGB_TOG:
241 if (record->event.pressed) {
242 switch (rgb_matrix_get_flags()) {
243 case LED_FLAG_ALL: {
244 rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
245 rgb_matrix_set_color_all(0, 0, 0);
246 }
247 break;
248 case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
249 rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
250 rgb_matrix_set_color_all(0, 0, 0);
251 }
252 break;
253 case LED_FLAG_UNDERGLOW: {
254 rgb_matrix_set_flags(LED_FLAG_NONE);
255 rgb_matrix_disable_noeeprom();
256 }
257 break;
258 default: {
259 rgb_matrix_set_flags(LED_FLAG_ALL);
260 rgb_matrix_enable_noeeprom();
261 }
262 break;
263 }
264 }
265 return false;
266 default:
267 return true; // Process all other keycodes normally
268 }
269}
270
271void set_layer_color(int layer) {
272 if (layer == 0) { return; }
273 for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
274 HSV hsv = {
275 .h = pgm_read_byte(&ledmap[layer][i][0]),
276 .s = pgm_read_byte(&ledmap[layer][i][1]),
277 .v = pgm_read_byte(&ledmap[layer][i][2]),
278 };
279 if (hsv.h || hsv.s || hsv.v) {
280 RGB rgb = hsv_to_rgb(hsv);
281 float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX;
282 rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b);
283 } else if (layer != 1) {
284 // Only deactivate non-defined key LEDs at layers other than FN. Because at FN we have RGB adjustments and need to see them live.
285 // If the values are all false then it's a transparent key and deactivate LED at this layer
286 rgb_matrix_set_color(i, 0, 0, 0);
287 }
288 }
289}
290
291void rgb_matrix_indicators_user(void) {
292
293 led_t host_leds = host_keyboard_led_state();
294 if (host_leds.caps_lock) {
295 //rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF);
296 rgb_matrix_set_color(30, 0x0, 0x0, 0x0);
297
298 } else {
299 //rgb_matrix_set_color(30, 0x0, 0x0, 0x0);
300 }
301 set_layer_color(get_highest_layer(layer_state));
302
303}
diff --git a/keyboards/bm68rgb/keymaps/peepeetee/keymap.h b/keyboards/bm68rgb/keymaps/peepeetee/keymap.h
new file mode 100644
index 000000000..e8d0170d4
--- /dev/null
+++ b/keyboards/bm68rgb/keymaps/peepeetee/keymap.h
@@ -0,0 +1,63 @@
1/* Copyright 2019 ash0x0 2021 peepeetee
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#include QMK_KEYBOARD_H
17
18#include "print.h"
19#include <string.h>
20// HID has not yet been implemented for this keyboard
21// #include "raw_hid.h"
22
23#define MILLISECONDS_IN_SECOND 1000
24
25// These are just to make it neater to use builtin HSV values in the keymap
26#define RED {HSV_RED}
27#define CORAL {HSV_CORAL}
28#define ORANGE {HSV_ORANGE}
29#define GOLDEN {HSV_GOLDENROD}
30#define GOLD {HSV_GOLD}
31#define YELLOW {HSV_YELLOW}
32#define CHART {HSV_CHARTREUSE}
33#define GREEN {HSV_GREEN}
34#define SPRING {HSV_SPRINGGREEN}
35#define TURQ {HSV_TURQUOISE}
36#define TEAL {HSV_TEAL}
37#define CYAN {HSV_CYAN}
38#define AZURE {HSV_AZURE}
39#define BLUE {HSV_BLUE}
40#define PURPLE {HSV_PURPLE}
41#define MAGENT {HSV_MAGENTA}
42#define PINK {HSV_PINK}
43
44//========================================================== CONFIGURABLE DEFAULTS ==========================================================
45#define RGB_DEFAULT_TIME_OUT 30
46#define RGB_FAST_MODE_TIME_OUT 3
47#define RGB_TIME_OUT_MAX 600
48#define RGB_TIME_OUT_MIN 10
49#define RGB_TIME_OUT_STEP 10
50
51extern bool g_suspend_state;
52bool disable_layer_color;
53
54uint8_t dfa_state; //state for my language switching DFA
55
56
57bool rgb_enabled_flag; // Current LED state flag. If false then LED is off.
58bool rgb_time_out_enable; // Idle LED toggle enable. If false then LED will not turn off after idle timeout.
59bool rgb_time_out_fast_mode_enabled; // Enable flag for RGB timeout fast mode
60bool rgb_time_out_user_value; // This holds the toggle value set by user with ROUT_TG. It's necessary as RGB_TOG changes timeout enable.
61uint16_t rgb_time_out_seconds; // Idle LED timeout value, in seconds not milliseconds
62uint16_t rgb_time_out_saved_seconds; // The saved user config for RGB timeout period
63led_flags_t rgb_time_out_saved_flag; // Store LED flag before timeout so it can be restored when LED is turned on again.
diff --git a/keyboards/bm68rgb/keymaps/peepeetee/readme.md b/keyboards/bm68rgb/keymaps/peepeetee/readme.md
new file mode 100644
index 000000000..47899c27e
--- /dev/null
+++ b/keyboards/bm68rgb/keymaps/peepeetee/readme.md
@@ -0,0 +1 @@
# peepeetee's keymap for the bm68rgb. Includes a DFA to set the windows system language back to English by pressing the top right button. Said DFA will only work with 4 languages(for now). \ No newline at end of file