Browse Source

Bringing all post-pull request updates to new Q2 'rev1' folder structure

pull/17398/head
gourdo1 2 years ago
parent
commit
5e659abd91
9 changed files with 659 additions and 150 deletions
  1. +79
    -12
      keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/config.h
  2. +314
    -24
      keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/keymap.c
  3. +48
    -0
      keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/paddlegame.h
  4. +49
    -25
      keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/readme.md
  5. +124
    -1
      keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/rgb_matrix_map.h
  6. +5
    -0
      keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/rules.mk
  7. +18
    -71
      users/gourdo1/gourdo1.c
  8. +20
    -15
      users/gourdo1/gourdo1.h
  9. +2
    -2
      users/gourdo1/gourdo1_encoder.c

+ 79
- 12
keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/config.h View File

@ -1,5 +1,5 @@
/* Copyright 2021 Jonavin Eng @Jonavin
Copyright 2022 gourdo1 <jcblake@outlook.com>
Copyright 2022 gourdo1 <gourdo1@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -17,8 +17,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
//Force n-key rollover
#define FORCE_NKRO
// Set TT to two taps
#define TAPPING_TOGGLE 2
// TT set to two taps
#ifdef COMMAND_ENABLE
#define IS_COMMAND() (get_mods() == MOD_MASK_CTRL) //debug commands accessed by holding down both CTRLs: https://github.com/qmk/qmk_firmware/blob/master/docs/feature_command.md
#endif
/* Handle GRAVESC combo keys */
#define GRAVE_ESC_ALT_OVERRIDE
@ -31,19 +38,79 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define TAPPING_TERM_PER_KEY
#ifdef RGB_MATRIX_ENABLE
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR
#define RGB_DISABLE_WHEN_USB_SUSPENDED
#endif
#define RGB_DISABLE_WHEN_USB_SUSPENDED
#define RGB_MATRIX_KEYPRESSES // Enables REACTIVE & SPLASH modes
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enables Heatmap, Rain
// RGB step values
#define RGBLIGHT_HUE_STEP 32 // The number of steps to cycle through the hue by (default 10)
#define RGBLIGHT_SAT_STEP 17 // The number of steps to increment the saturation by (default 17)
#define RGBLIGHT_VAL_STEP 17 // The number of steps to increment the brightness by (default 17)
// Startup values, when none have been set
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_REACTIVE // Sets the default effect mode, if none has been set (was RGB_MATRIX_SOLID_COLOR)
#define RGB_MATRIX_STARTUP_HUE 20 // Sets the default hue value, if none has been set
#define RGB_MATRIX_STARTUP_SAT 255 // Sets the default saturation value, if none has been set
#define RGB_MATRIX_STARTUP_VAL 127 // Sets the default brightness value, if none has been set
#define RGB_MATRIX_STARTUP_SPD 127 // Sets the default animation speed, if none has been set
// RGB step values
#define RGBLIGHT_HUE_STEP 32 // The number of steps to cycle through the hue by (default 10)
#define RGBLIGHT_SAT_STEP 17 // The number of steps to increment the saturation by (default 17)
#define RGBLIGHT_VAL_STEP 17 // The number of steps to increment the brightness by (default 17)
// Uncomment any #undef line below to turn OFF any default enabled RGB background effect (enabled in keyboards/gmmk/pro/config.h).
#undef ENABLE_RGB_MATRIX_ALPHAS_MODS // Solid color (seems redundant; seems same as RGB_MATRIX_SOLID_COLOR?)
//#undef ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static, horizontal rainbow
//#undef ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT // Static, vertical Rainbow
//#undef ENABLE_RGB_MATRIX_BREATHING // Breathing animation using selected HSV color
#undef ENABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right (with white)
//#undef ENABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right (with black)
#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades sat (with white)
//#undef ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL // Single hue 3 blade spinning pinwheel fades brightness (with black)
#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT // Single hue spinning spiral fades brightness (with white)
//#undef ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL // Single hue spinning spiral fades brightness (with black)
//#undef ENABLE_RGB_MATRIX_CYCLE_ALL // Full keyboard cycling through rainbow
//#undef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Full gradient moving left to right
//#undef ENABLE_RGB_MATRIX_CYCLE_UP_DOWN // Full gradient scrolling top to bottom
#undef ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON // Full gradient chevron scrolling left to right (too similar to cycle left right)
//#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN // Rainbow circles coming to center.
#undef ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL // Two Rainbow circles coming to 1/3 and 2/3 points. (seems mostly redundant with above)
#undef ENABLE_RGB_MATRIX_CYCLE_PINWHEEL // Built-in cycling pinwheel (seems redundant with below)
//#undef ENABLE_RGB_MATRIX_CYCLE_SPIRAL // Full gradient spinning spiral around center of keyboard
#undef ENABLE_RGB_MATRIX_RAINBOW_BEACON // Spinning rainbow (more distracting transitions)
//#undef ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS // Spinning rainbow (smoother)
#undef ENABLE_RGB_MATRIX_DUAL_BEACON // Two rainbows spinning around keyboard (distracting, busy)
#undef ENABLE_RGB_MATRIX_RAINDROPS // Sustained raindrops of blue, green, yellow (confusing to use with RGB layers)
//#undef ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS // Sustained raindrops of blue, purple, pink, green (confusing to use with RGB layers, but slightly better than above)
#undef ENABLE_RGB_MATRIX_HUE_BREATHING // Hue shifts up a slight amount at the same time, then shifts back (very subtle)
#undef ENABLE_RGB_MATRIX_HUE_PENDULUM // Hue shifts up a slight amount in a wave to the right, then back to the left (very subtle)
#undef ENABLE_RGB_MATRIX_HUE_WAVE // Hue shifts up a slight amount and then back down in a wave to the right (very subtle)
//#undef ENABLE_RGB_MATRIX_PIXEL_RAIN // Non-sustained raindrops of pastel colors
#undef ENABLE_RGB_MATRIX_PIXEL_FLOW // More active version of pixel rain with quick cycling (unusable, very distracting)
#undef ENABLE_RGB_MATRIX_PIXEL_FRACTAL // Same as Pixel Flow but with current HSV only (somewhat distracting)
//Only enabled if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
//#undef ENABLE_RGB_MATRIX_TYPING_HEATMAP // Fading heatmap that follows keystrokes (has buggy side LEDs that glow red)
//#undef ENABLE_RGB_MATRIX_DIGITAL_RAIN // The Matrix (has buggy side LEDs that glow red)
//Only enabled if RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
//#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE // Key hits shown in current hue - all other keys black
//#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE // Keyboard lights up in chosen hue, key hits shown in complementary hue (try this as default?)
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse around a single key hit then fades value out (Single key)
//#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // same as above but more intense (Multi-key)
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS // Column and Row single current color fade (Single key)
//#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Column and Row single color fade. (Multi-key)
#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of key hit then fades (Single key)
//#undef ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multi-key hit then fades
//#undef ENABLE_RGB_MATRIX_SPLASH // Full rainbow pulses from key hit. All else black.
#undef ENABLE_RGB_MATRIX_MULTISPLASH // Full rainbow pulses from multi-keys. All else black. (distracting on multiple keystroke hits)
#undef ENABLE_RGB_MATRIX_SOLID_SPLASH // Single color pulses from key hit. All else black. (distracting on multiple key hits)
//#undef ENABLE_RGB_MATRIX_SOLID_MULTISPLASH // Single color pulses from muli-keys. All else black.
#endif //RGB_MATRIX_ENABLE
// add fifth layer for colemak -- set "COLEMAK_LAYER_ENABLE = yes" in rules.mk to enable
// add a layer for colemak -- set "COLEMAK_LAYER_ENABLE = yes" in rules.mk to enable
#if defined COLEMAK_LAYER_ENABLE
#define DYNAMIC_KEYMAP_LAYER_COUNT 5
#define _COLEMAK 4
#ifdef GAME_ENABLE
#define DYNAMIC_KEYMAP_LAYER_COUNT 6
#define _COLEMAK 5
#else
#define DYNAMIC_KEYMAP_LAYER_COUNT 5
#define _COLEMAK 4
#endif //GAME_ENABLE
#endif // COLEMAK_LAYER_ENABLE
/*


+ 314
- 24
keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/keymap.c View File

@ -1,6 +1,6 @@
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
Copyright 2021 Jonavin Eng @Jonavin
Copyright 2022 gourdo1 <jcblake@outlook.com>
Copyright 2022 gourdo1 <gourdo1@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Note: Several advanced functions referenced in this file (like Tap Dance functions) are defined in users/gourdo1/gourdo1.c
// Note: Several advanced functions referenced in this file (like Tap Dance functions) are defined in /users/gourdo1/gourdo1.c
#include QMK_KEYBOARD_H
@ -24,6 +24,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "gourdo1.h"
#include "paddlegame.h"
#include <math.h>
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base Layout
@ -55,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* FN1 Layout
*
* ,-------------------------------------------------------------------------------------------------------------.
* | Esc ||MyCmp |WbHom | Calc |MdSel ||MdPrv |MdNxt |MdPly |MdStp ||VolDn |VolUp |PrScr |ScrLk ||Pause || ____ |
* | Esc ||MyCmp |WbHom | Calc |MdSel ||MdPrv |MdNxt |MdPly |MdStp ||VolDn |VolUp |PrScr |ScrLk ||Pause ||Sleep |
* |=============================================================================================================|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |RGBTOD|RGBTOI| ________ ||RGBTOG|
* |------+------+------+------+------+------+------+------+------+------+------+------+------+----------++------|
@ -63,21 +67,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |---------+------+------+------+------+------+------+------+------+------+------+------+------+-------++------|
* | Capslock |RGBHUD|RGBVAD|RGBHUI| ____|GMAIL |HTMAIL| ____ | ____ | ____ | ____ | ____ | __________ || End |
* |------------+------+------+------+-----+------+------+------+------+------+------+------|----+========+------|
* | __________ |RGBNIT| ____ | ____ | ____ | ____ |NumLk | ____ | ____ |DOTCOM| ____ | ______ ||RGBMOD|| ____ |
* | __________ |RGBNIT| ____ | ____ | ____ | ____ |NumLk | ____ | ____ |DOTCOM| CAD | ______ ||RGBMOD|| ____ |
* |--------------+------+------+------+------+------+------+------+------+------+------+--+=====++------++======|
* | ____ | WinKyLk | ____ | _____ | ____ | ____ | ____ ||RGBSPD|RGBRMD|RGBSPI|
* `------------------------------------------------------------------------------------------------------------'
*/
#ifdef GAME_ENABLE
[_FN1] = LAYOUT(
EE_CLR, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MNXT, KC_MPLY, KC_MSTP, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOD, RGB_TOI, _______, RGB_TOG,
_______, RGB_SAD, RGB_VAI, RGB_SAI, NK_TOGG, _______, YAHOO, _______, _______, OUTLOOK, KC_PAUS, SWAP_L, SWAP_R, RESET, KC_HOME,
KC_CAPS, RGB_HUD, RGB_VAD, RGB_HUI, _______, GMAIL, HOTMAIL, _______, _______, _______, _______, _______, _______, KC_END,
_______, RGB_NITE,_______, _______, _______, _______, KC_NLCK, _______, _______, DOTCOM, KC_CAD, _______, RGB_MOD, _______,
EE_CLR, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MNXT, KC_MPLY, KC_MSTP, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, KC_SLEP,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOD, RGB_TOI, _______, RGB_TOG,
_______, RGB_SAD, RGB_VAI, RGB_SAI, NK_TOGG, _______, YAHOO, _______, _______, OUTLOOK, TG(_GAME),SWAP_L, SWAP_R, RESET, KC_HOME,
KC_CAPS, RGB_HUD, RGB_VAD, RGB_HUI, _______, GMAIL, HOTMAIL, _______, _______, LOCKPC, _______, _______, _______, KC_END,
_______, RGB_NITE,_______, _______, _______, _______, KC_NLCK, _______, _______, DOTCOM, KC_CAD, _______, RGB_MOD, _______,
_______, KC_WINLCK, _______, _______, _______, _______, _______, RGB_SPD, RGB_RMOD, RGB_SPI
),
[_GAME] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
#else
[_FN1] = LAYOUT(
EE_CLR, KC_MYCM, KC_WHOM, KC_CALC, KC_MSEL, KC_MPRV, KC_MNXT, KC_MPLY, KC_MSTP, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, KC_SLEP,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOD, RGB_TOI, _______, RGB_TOG,
_______, RGB_SAD, RGB_VAI, RGB_SAI, NK_TOGG, _______, YAHOO, _______, _______, OUTLOOK, KC_PAUS, SWAP_L, SWAP_R, RESET, KC_HOME,
KC_CAPS, RGB_HUD, RGB_VAD, RGB_HUI, _______, GMAIL, HOTMAIL, _______, _______, LOCKPC, _______, _______, _______, KC_END,
_______, RGB_NITE,_______, _______, _______, _______, KC_NLCK, _______, _______, DOTCOM, KC_CAD, _______, RGB_MOD, _______,
_______, KC_WINLCK, _______, _______, _______, _______, _______, RGB_SPD, RGB_RMOD, RGB_SPI
),
#endif //GAME_ENABLE
/* _NUMPADMOUSE Layout
* Note: A symbol preceded by "P" is a Numpad-encoded version of the key -- any app that differentiates will recognize the char as coming from a physical numpad.
* ,-------------------------------------------------------------------------------------------------------------.
@ -101,7 +126,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_PGUP, KC_UP, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, _______, KC_WH_U,
_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_PAST, _______, KC_PENT, KC_WH_D,
_______, KC_NO, _______, _______, _______, KC_NO, KC_NO, KC_P0, KC_00, KC_PDOT, KC_PSLS, KC_BTN1, KC_MS_U, KC_BTN2,
_______, _______, _______, _______, _______, _______, KC_BTN3, KC_MS_L, KC_MS_D, KC_MS_R
_______, _______, _______, KC_PENT, _______, _______, KC_BTN3, KC_MS_L, KC_MS_D, KC_MS_R
),
[_MOUSEKEY] = LAYOUT(
@ -115,19 +140,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#ifdef COLEMAK_LAYER_ENABLE
[_COLEMAK] = LAYOUT(
_______, 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_DEL, KC_MUTE,
_______, 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_DEL, KC_MUTE,
KC_GRV, 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,
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGDN,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
_______, _______, _______, KC_SPC, KC_RALT, _______,KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGDN,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
_______, _______, _______, KC_SPC, KC_RALT, _______,KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
#endif // COLEMAK_LAYER_ENABLE
};
#if defined(ENCODER_ENABLE) && !defined(ENCODER_DEFAULTACTIONS_ENABLE) // Encoder Functionality when not using userspace defaults
void encoder_action_rgbhue(bool clockwise) {
if (clockwise)
if (clockwise)
rgblight_increase_hue_noeeprom();
else
rgblight_decrease_hue_noeeprom();
@ -154,6 +179,18 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
timeout_update_threshold(clockwise);
#endif
break;
#ifdef GAME_ENABLE
case _GAME:
// Game: Paddle movement
if (damage_count == 0) {
if (clockwise) {
if (paddle_pos_full < 15) ++paddle_pos_full;
} else {
if (paddle_pos_full > 0) --paddle_pos_full;
}
}
break;
#endif //GAME_ENABLE
default:
encoder_action_volume(clockwise); // Otherwise it just changes volume
break;
@ -165,6 +202,45 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif // ENCODER_ENABLE && !ENCODER_DEFAULTACTIONS_ENABLE
#ifdef RGB_MATRIX_ENABLE
// Game logic
#ifdef GAME_ENABLE
void init_ball(uint8_t i) {
i &= 1;
ball[i].on = true;
ball[i].up = false;
ball[i].y = 0;
ball[i].x = rand() % 16;
// Set initial ball state
if (ball[i].x < 8) {
ball[i].left = false;
} else {
ball[i].x -= 4;
ball[i].left = true;
}
// 1/4 chance of being an enemy ball after level 6
if (level_number > 3) {
ball[i].enemy = ((rand() % 4) == 0);
} else {
ball[i].enemy = false;
}
}
void hurt_paddle(void) {
if (paddle_lives > 0) {
--paddle_lives;
}
damage_timer = timer_read();
damage_count = 10;
// Reset board
init_ball(0);
ball[1].on = false;
}
#endif //GAME_ENABLE
// Capslock, Scroll lock and Numlock indicator on Left side lights.
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
if (get_rgb_nightmode()) rgb_matrix_set_color_all(RGB_OFF);
@ -174,6 +250,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
rgb_matrix_set_color(LED_L3, RGB_RED);
rgb_matrix_set_color(LED_L4, RGB_RED);
rgb_matrix_set_color(LED_TAB, RGB_RED);
rgb_matrix_set_color(LED_F12, RGB_RED);
}
// System NumLock warning indicator RGB setup
@ -239,9 +316,9 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
rgb_matrix_set_color(LED_LALT, RGB_RED);
rgb_matrix_set_color(LED_SPC, RGB_RED);
rgb_matrix_set_color(LED_LWIN, RGB_RED);
rgb_matrix_set_color(LED_RALT, RGB_RED);
//rgb_matrix_set_color(LED_RALT, RGB_RED);
rgb_matrix_set_color(LED_FN, RGB_OFFBLUE);
rgb_matrix_set_color(LED_RCTL, RGB_RED);
//rgb_matrix_set_color(LED_RCTL, RGB_RED);
rgb_matrix_set_color(LED_BSLS, RGB_RED);
rgb_matrix_set_color(LED_L1, RGB_RED);
rgb_matrix_set_color(LED_L2, RGB_RED);
@ -264,6 +341,11 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
rgb_matrix_set_color(LED_R8, RGB_RED);
rgb_matrix_set_color(LED_MINS, RGB_OFFBLUE);
rgb_matrix_set_color(LED_EQL, RGB_OFFBLUE);
#ifdef GAME_ENABLE
rgb_matrix_set_color(LED_P, RGB_CHARTREUSE);
#else
rgb_matrix_set_color(LED_P, RGB_RED);
#endif // GAME_ENABLE
// Add RGB Timeout Indicator -- shows 0 to 139 using F row and num row; larger numbers using 16bit code
uint16_t timeout_threshold = get_timeout_threshold();
@ -308,19 +390,229 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
rgb_matrix_set_color(LED_END, RGB_CYAN);
rgb_matrix_set_color(LED_PGUP, RGB_OFFBLUE);
rgb_matrix_set_color(LED_PGDN, RGB_OFFBLUE);
break;
// Colemak layer RGB
#ifdef COLEMAK_LAYER_ENABLE
// Colemak layer RGB
#ifdef COLEMAK_LAYER_ENABLE
case _COLEMAK:
for (uint8_t i = 0; i < ARRAYSIZE(LED_SIDE_RIGHT); i++) {
rgb_matrix_set_color(LED_SIDE_RIGHT[i], RGB_MAGENTA);
rgb_matrix_set_color(LED_SIDE_LEFT[i], RGB_MAGENTA);
}
break;
#endif
#endif
// Paddle game logic
#ifdef GAME_ENABLE
case _GAME:
if (!game_start) {
srand((unsigned int) timer_read());
// Store user light settings
last_hsv = rgb_matrix_get_hsv();
rgb_matrix_sethsv_noeeprom(0, 0, 0);
paddle_pos_full = 8;
paddle_lives = 4;
bounce_count = 0;
level_number = 0;
damage_count = 0;
init_ball(0);
ball[1].on = false;
ball_timer = timer_read();
game_start = true;
}
// Set level indicator
if (level_number < 12) {
rgb_matrix_set_color(GAME_R0[level_number], RGB_BLUE);
}
// Set life bar
for (uint8_t i = 0; i < paddle_lives; i++) {
rgb_matrix_set_color(GAME_LIVES[i], RGB_GREEN);
}
uint8_t paddle_pos = paddle_pos_full >> 1;
if (damage_count > 0) {
// Flash paddle when receiving damage
if (timer_elapsed(damage_timer) > 500) {
--damage_count;
damage_timer = timer_read();
}
if ((damage_count & 1) == 0) {
for (uint8_t i = 0; i < 3; i++) {
rgb_matrix_set_color(GAME_PADDLE[paddle_pos + i], RGB_RED);
}
}
if (damage_count == 0) {
ball_timer = timer_read();
}
} else if (paddle_lives == 0) {
// Game over
for (uint8_t i = 0; i < sizeof(LED_GAME_OVER) / sizeof(LED_GAME_OVER[0]); i++) {
rgb_matrix_set_color(LED_GAME_OVER[i], RGB_RED);
}
} else if (level_number >= 12) {
// You win
if (rgb_value.r == 0xff && rgb_value.g < 0xff) {
if (rgb_value.b > 0) {
--rgb_value.b;
} else {
++rgb_value.g;
}
} else if (rgb_value.g == 0xff && rgb_value.b < 0xff) {
if (rgb_value.r > 0) {
--rgb_value.r;
} else {
++rgb_value.b;
}
} else if (rgb_value.b == 0xff && rgb_value.r < 0xff) {
if (rgb_value.g > 0) {
--rgb_value.g;
} else {
++rgb_value.r;
}
}
for (uint8_t i = 0; i < 3; i++) {
rgb_matrix_set_color(GAME_PADDLE[paddle_pos + i], rgb_value.r, rgb_value.g, rgb_value.b);
}
rgb_matrix_set_color(GAME_SMILE1[paddle_pos], rgb_value.r, rgb_value.g, rgb_value.b);
rgb_matrix_set_color(GAME_SMILE1[paddle_pos + 3], rgb_value.r, rgb_value.g, rgb_value.b);
rgb_matrix_set_color(GAME_SMILE2[paddle_pos], rgb_value.r, rgb_value.g, rgb_value.b);
rgb_matrix_set_color(GAME_SMILE2[paddle_pos + 3], rgb_value.r, rgb_value.g, rgb_value.b);
} else {
// normal game loop
// Set paddle position
for (uint8_t i = 0; i < 3; i++) {
rgb_matrix_set_color(GAME_PADDLE[paddle_pos + i], RGB_GREEN);
}
// Ball movement logic happens at intervals
if (timer_elapsed(ball_timer) > GAME_TIMER[level_number]) {
for (int i = 0; i < 2; ++i) {
if (ball[i].on) {
// Ball movement
if (ball[i].up) {
if (ball[i].y > 0) {
--ball[i].y;
if (!ball[i].left) ++ball[i].x;
} else {
// Count reflections. If > 10, increase level
++bounce_count;
if (bounce_count >= 10) {
bounce_count = 0;
++level_number;
}
ball[i].on = false;
}
} else {
++ball[i].y;
if (ball[i].left) --ball[i].x;
if (ball[i].y > 4) {
// Remove a life if ball isn't returned and isn't enemy
if (!ball[i].enemy) {
hurt_paddle();
i = 2;
} else {
ball[i].on = false;
}
}
}
}
}
if (ball[0].y == 4 && !ball[1].on) {
init_ball(1);
}
if (ball[1].y == 4 && !ball[0].on) {
init_ball(0);
}
if (!ball[0].on && !ball[1].on) {
init_ball(0);
}
ball_timer = timer_read();
}
// Other ball stuff
for (int i = 0; i < 2; ++i) {
if (ball[i].on) {
// Ball deflection logic
if (!ball[i].up && ball[i].y == 4 && (ball[i].x == paddle_pos || ball[i].x == paddle_pos - 1 || ball[i].x == paddle_pos + 1)) {
if (!ball[i].enemy) {
--ball[i].y;
if (!ball[i].left) {
++ball[i].x;
}
ball[i].up = true;
} else {
hurt_paddle();
i = 2;
}
}
// Ball display
switch (ball[i].y) {
case 0:
if (ball[i].enemy) {
rgb_matrix_set_color(GAME_R0[ball[i].x], RGB_RED);
} else {
rgb_matrix_set_color(GAME_R0[ball[i].x], RGB_WHITE);
}
break;
case 1:
if (ball[i].enemy) {
rgb_matrix_set_color(GAME_R1[ball[i].x], RGB_RED);
} else {
rgb_matrix_set_color(GAME_R1[ball[i].x], RGB_WHITE);
}
break;
case 2:
if (ball[i].enemy) {
rgb_matrix_set_color(GAME_R2[ball[i].x], RGB_RED);
} else {
rgb_matrix_set_color(GAME_R2[ball[i].x], RGB_WHITE);
}
break;
case 3:
if (ball[i].enemy) {
rgb_matrix_set_color(GAME_R3[ball[i].x], RGB_RED);
} else {
rgb_matrix_set_color(GAME_R3[ball[i].x], RGB_WHITE);
}
break;
case 4:
if (ball[i].enemy) {
rgb_matrix_set_color(GAME_R4[ball[i].x], RGB_RED);
} else {
rgb_matrix_set_color(GAME_R4[ball[i].x], RGB_WHITE);
}
break;
}
}
}
}
break;
#endif //GAME_ENABLE
default:
#ifdef GAME_ENABLE
if (game_start) {
// Reset lighting settings
game_start = false;
rgb_matrix_sethsv_noeeprom(last_hsv.h, last_hsv.s, last_hsv.v);
}
#endif //GAME_ENABLE
break;
}
}
@ -329,8 +621,6 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
void keyboard_post_init_keymap(void) {
// keyboard_post_init_user() moved to userspace
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR);
rgb_matrix_sethsv_noeeprom(20, 255, 127); // Default startup color (Hue:amber Saturation:full Value(brightness):mid)
activate_rgb_nightmode(false); // Set to true if you want to startup in nightmode, otherwise use Fn + Z to toggle
#endif
}

+ 48
- 0
keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/paddlegame.h View File

@ -0,0 +1,48 @@
/* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
Copyright 2021 Tomas Guinan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef GAME_ENABLE
const uint16_t GAME_TIMER[] = {
400, 350, 300, 250, 400, 350, 300, 250, 225, 200, 175, 150
};
bool game_start = false;
HSV last_hsv;
static uint8_t paddle_pos_full;
static uint8_t paddle_lives;
static uint8_t level_number;
static uint8_t bounce_count;
static uint8_t damage_count;
static uint16_t damage_timer;
static uint16_t ball_timer;
struct BallStruct
{
uint8_t x;
uint8_t y;
bool on;
bool up;
bool left;
bool enemy;
};
struct BallStruct ball[2];
void init_ball(uint8_t i);
void hurt_paddle(void);
#endif //GAME_ENABLE

+ 49
- 25
keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/readme.md View File

@ -1,6 +1,6 @@
# gourdo1's GMMK Pro ANSI layout
# [gourdo1's](mailto:gourdo1@outlook.com) GMMK Pro ANSI layout
This Windows-centric layout is based on [Jonavin's](https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin) GMMK Pro layout with several additions, modifications, a tweaked keymap, updated layers and expanded RGB controls.
This Windows-centric ANSI layout is based on [Jonavin's](https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/jonavin) GMMK Pro layout with several additions, fixes, a tweaked keymap, updated layers, [Tomas Guinan's paddle game](https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/paddlegame) and expanded RGB controls.
![image](https://raw.githubusercontent.com/gourdo1/media/main/susuwatari.jpg)
@ -10,24 +10,33 @@ This Windows-centric layout is based on [Jonavin's](https://github.com/qmk/qmk_f
* [VIA](https://www.caniusevia.com/) support enabled (added Mar 16, 2022)
* Most [default Glorious shortcuts](https://cdn.shopify.com/s/files/1/0549/2681/files/GMMK_Pro_User_Guide.pdf) enabled
* [N-key Rollover](https://en.wikipedia.org/wiki/Rollover_\(keyboard\)#n-key_rollover) (NKRO) -- toggled with FN+R
* Gaming mode (FN + Win-key) locks out Win-key as well as double-tap Shift Capslock; Also RGB highlights WSAD and nearby gaming related keys
* [N-key Rollover](https://en.wikipedia.org/wiki/Rollover_\(keyboard\)#n-key_rollover) (NKRO) -- toggled with Fn+R
* 1000Hz polling rate with 5ms debounce time for quick response in games
* Mouse Keys! Don't want to move your hands off the keyboard or you didn't bring it with you on the road? Use cursor keys to move the mouse.
* Overlay numpad on 789-UIOP-JKL;-M,. & Space-bar mapped to Enter key for rapid number entry
* Gaming mode (Fn+Win-key) locks out Win-key as well as double-tap Shift Capslock; Also RGB highlights WSAD and nearby gaming related keys
* [Caps Word](https://getreuer.info/posts/keyboards/caps-word/index.html) enabled: To capitalize the next word only, press and release both left and right shift keys at the same time. (added Feb 25, 2022)
* Multi-monitor app moving shortcuts: FN + [,] (square brackets) to move current app window to next monitor (added Apr 11, 2022)
* Domain shortcuts: FN+.=".com", FN+O="outlook.com", FN+Y="yahoo.com", FN+H="hotmail.com", FN+G="gmail.com". (added Apr 7, 2022)
* Capslock toggled by double tap of Left Shift key or FN + Capslock (RGB green highlighted)
* Multi-monitor app moving shortcuts: Fn+[,] (square brackets) to move current app window to next monitor (added Apr 11, 2022)
* Capslock toggled by double tap of Left Shift key or Fn + Capslock (RGB green highlighted)
* Paddle game accessible via Fn+P; Hit Fn+P again or double tap ESC to exit (added May 5, 2022)
* Single-handed shortcut for Ctrl-Alt-Delete: Fn+/ (added May 14, 2022)
* Single-handed shortcut for Win-L (lock Windows): Fn+L (added May 17, 2022)
* Domain shortcuts: Fn+.=".com", Fn+O="outlook.com", Fn+Y="yahoo.com", Fn+H="hotmail.com", Fn+G="gmail.com". (added Apr 7, 2022)
* Fn-Backslash for [Bootloader mode](https://github.com/qmk/qmk_firmware/blob/master/docs/newbs_flashing.md)
* Home key on F13, Del key right of Backspace
* Insert accessible via Shift-Backspace (so shift delete still works in Windows Explorer)
* PrtScrn, Scroll Lock, Pause/Break are top right on the keyboard: Fn+F11, Fn+F12, Fn+F13
* [Colemak](https://colemak.com/) key layout support (Layer accessible via Left Shift + turn Encoder clockwise until side LEDs light up purple)
* Double tap ESC any time to revert to base layer (added Feb 26, 2022)
* RGB backlight effects expanded to include framebuffer effects and reactive keypress modes (updated May 24, 2022)
* RGB backlight now remembers last color & effect settings after power down (updated May 24, 2022)
### Numpad + Mouse Keys (Capslock key)
* Overlay numpad + [Mouse Keys](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_mouse_keys.md) are accessed through Capslock key hold (temp) or double press (locked) with RGB highlighting
* Numpad uses Space-bar as Enter for rapid number entry (added May 17, 2022)
* This layer disables much of the keyboard, except X/C/V for cut/copy/paste, WASD for cursor, Q/E for PgUp/PgDn, cursor keys become mouse keys, surrounding keys become mouse buttons and all number keys become numpad versions (so Alt char codes work regardless of which set you use)
* Fn & N keys light up orange if system numlock is off (inverted status), indicating numpad keys will not deliver expected output (FN + N to toggle)
* Fn and N keys light up orange if system numlock is off (inverted status), indicating numpad keys will not deliver expected output (Fn+N to toggle)
* Double zero on comma key.
* [Mouse Keys](https://github.com/qmk/qmk_firmware/blob/master/docs/feature_mouse_keys.md) allow you to use the mouse without taking your hand off the keyboard. (added Mar 15, 2022)
* Mouse controls are: Cursor keys = move mouse; RShift = button1, End = button2, RCtrl = button3, PgUp/PgDn = Scroll wheel
@ -37,31 +46,45 @@ This Windows-centric layout is based on [Jonavin's](https://github.com/qmk/qmk_f
* Default knob turn changes volume; button press toggles mute
* Exponential encoder - quick repeated volume up doubles increase; quick repeated volume down triples decrease (added Feb 17, 2022)
* FN knob turn changes RGB idle timeout
* Fn + knob turn changes RGB idle timeout
* Fn + knob push puts PC to Sleep (Added May 14, 2022)
* holding Left Shift changes layers
* holding Right Shift navigates page up/down
* holding Left Ctrl navigates prev/next word
* holding Right Ctrl changes RGB hue/color
* holding Left Alt changes media prev/next track
### Paddle Game
* Based on [Tomas Guinan's excellent GMMK Pro paddle game](https://github.com/qmk/qmk_firmware/tree/master/keyboards/gmmk/pro/ansi/keymaps/paddlegame)
* Paddle Game playable by pressing Fn+P (P lights up green in Fn layer if game is enabled in firmware, otherwise it lights up red)
* Use rotary encoder to control paddle
* Contains 12 levels, indicated by blue LED on F-key row
* Player has 4 lives, indicated by nav cluster
* Deflect white balls while avoiding red ones
* Use Fn+P, double tap ESC or otherwise change layer to quit game
### Global RGB Controls
* RGB backlight lighting effect: FN + up/down
* RGB backlight effect speed: FN + left/right
* RGB backlight hue cycle: FN + A/D
* RGB backlight brightness: FN + W/S
* RGB backlight saturation: FN + Q/E (added Feb 4, 2022)
* RGB backlight night mode toggle: FN + Z (indicators still work)
* RGB backlight timeout: FN + Encoder or "-" and "=" (default 15 minutes) (updated Apr 7, 2022)
* indicators in FN layer using RGB in F-key and number rows to show the current timeout in minutes
* RGB indicators on left side LEDs: Capslock (green), Scroll Lock (red), and Num Lock not set (orange)
* FN + Z to turn off RGB backlighting; press again to toggle
* RGB backlight lighting effect: Fn+up/down
* RGB backlight effect speed: Fn+left/right
* RGB backlight hue cycle: Fn+A/D
* RGB backlight brightness: Fn+W/S
* RGB backlight saturation: Fn+Q/E (added Feb 4, 2022)
* RGB backlight night mode toggle: Fn+Z (indicators still work)
* RGB backlight timeout: Fn+Encoder or "-" and "=" (default 15 minutes) (updated Apr 7, 2022)
* indicators in Fn layer using RGB in F-key and number rows to show the current timeout in minutes
* Fn+Z to turn off RGB backlighting (indicator lights still work); press again to toggle
* RGB indicators on left side LEDs in order from top: System NumLock off (orange), Scroll Lock (red), Numpad (blue), Capslock (green).
### Advanced Controls
* FN + \ to get to bootloader mode
* FN + [ESC] to clear EEPROM (then unplug and re-plug) (added Apr 11, 2022)
* FN + R to toggle N-key Rollover (added Apr 11, 2022)
* Fn+\ to get to bootloader mode
* Fn+[ESC] to clear EEPROM (then unplug and re-plug) (added Apr 11, 2022)
* Fn+R to toggle N-key Rollover (added Apr 11, 2022)
* Fn+/ is single-handed shortcut to Ctrl-Alt-Delete (added May 14, 2022)
* Fn+L is single-handed shortcut to Win-L (lock Windows) (added May 17, 2022)
* Fn+[Encoder press] to sleep Windows PC (added May 14, 2022)
Link to latest firmware binary: https://github.com/gourdo1/media/raw/main/gmmk_pro_ansi_gourdo1.bin
@ -70,7 +93,7 @@ Link to cheatsheet: https://github.com/gourdo1/media/raw/main/GMMK_Pro_Cheatshee
## rules.mk Options
STARTUP_NUMLOCK_ON = yes - turns on NUMLOCK by default
STARTUP_NUMLOCK_ON = yes - Turns on NUMLOCK by default
ENCODER_DEFAULTACTIONS_ENABLE = yes - Enabled default encoder functions
@ -78,10 +101,11 @@ TD_LSFT_CAPSLOCK_ENABLE = yes - This will enable double tap on Left Shift
IDLE_TIMEOUT_ENABLE = yes - Enables Timer functionality; for RGB idle timeouts that can be changed dynamically
INVERT_NUMLOCK_INDICATOR - inverts the Numlock indicator, LED is on when numlock is off -- numlock interferes with numpad keys, so should generally be off when numpad layer is active.
INVERT_NUMLOCK_INDICATOR - Inverts the Numlock indicator, LED is on when numlock is off -- numlock interferes with overlay numpad, so should be off when numpad layer is active unless you have an external numpad.
COLEMAK_LAYER_ENABLE = yes - Enable optional 5th layer for COLEMAK layout. Use Shift + encoder to enter 5th layer.
COLEMAK_LAYER_ENABLE = yes - Enables optional 5th layer for COLEMAK layout. Use Shift + encoder to enter 5th layer.
GAME_ENABLE ?= yes - Enables Paddle Game
## Layer Diagrams
### Base layer


+ 124
- 1
keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/rgb_matrix_map.h View File

@ -1,5 +1,5 @@
/* Copyright 2021 Jonavin Eng @Jonavin
Copyright 2022 gourdo1 <jcblake@outlook.com>
Copyright 2022 gourdo1 <gourdo1@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -16,6 +16,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef RGB_MATRIX_ENABLE
//Define variables for Game
bool fn_active = false;
RGB rgb_value;
// Custom GMMK Pro-specific RGB color customizations (defaults found in quantum/color.h)
#define RGB_GODSPEED 0x00, 0xE4, 0xFF // color for matching keycaps
#define RGB_NAUTILUS 0x00, 0xA4, 0xA9 // Nautilus Font colors
@ -284,4 +289,122 @@ const uint8_t LED_SIDE_RIGHT[] = {
LED_R8
};
#ifdef GAME_ENABLE
// Game LED rules
const uint8_t GAME_LIVES[] = {
LED_DEL,
LED_PGUP,
LED_PGDN,
LED_END
};
const uint8_t GAME_PADDLE[] = {
LED_Z,
LED_X,
LED_C,
LED_V,
LED_B,
LED_N,
LED_M,
LED_COMM,
LED_DOT,
LED_SLSH
};
const uint8_t GAME_SMILE1[] = {
LED_A,
LED_S,
LED_D,
LED_F,
LED_G,
LED_H,
LED_J,
LED_K,
LED_L,
LED_SCLN,
LED_QUOT
};
const uint8_t GAME_SMILE2[] = {
LED_2,
LED_3,
LED_4,
LED_5,
LED_6,
LED_7,
LED_8,
LED_9,
LED_0,
LED_MINS,
LED_EQL
};
const uint8_t GAME_R4[] = {
LED_X,
LED_C,
LED_V,
LED_B,
LED_N,
LED_M,
LED_COMM,
LED_DOT
};
const uint8_t GAME_R3[] = {
LED_S,
LED_D,
LED_F,
LED_G,
LED_H,
LED_J,
LED_K,
LED_L,
LED_SCLN
};
const uint8_t GAME_R2[] = {
LED_W,
LED_E,
LED_R,
LED_T,
LED_Y,
LED_U,
LED_I,
LED_O,
LED_P,
LED_LBRC
};
const uint8_t GAME_R1[] = {
LED_2,
LED_3,
LED_4,
LED_5,
LED_6,
LED_7,
LED_8,
LED_9,
LED_0,
LED_MINS,
LED_EQL
};
const uint8_t GAME_R0[] = {
LED_F1,
LED_F2,
LED_F3,
LED_F4,
LED_F5,
LED_F6,
LED_F7,
LED_F8,
LED_F9,
LED_F10,
LED_F11,
LED_F12
};
const uint8_t LED_GAME_OVER[] = {
LED_5,
LED_8,
LED_F,
LED_G,
LED_H,
LED_J,
LED_C,
LED_M
};
#endif //GAME_ENABLE
#endif

+ 5
- 0
keyboards/gmmk/pro/rev1/ansi/keymaps/gourdo1/rules.mk View File

@ -16,3 +16,8 @@ ENCODER_DEFAULTACTIONS_ENABLE = no
COLEMAK_LAYER_ENABLE = yes # Enable Colemak layer / set to no to disable
INVERT_NUMLOCK_INDICATOR = yes
GAME_ENABLE ?= yes # Enable Paddle Game / set to no to disable
ifeq ($(strip $(GAME_ENABLE)), yes)
OPT_DEFS += -DGAME_ENABLE
endif

+ 18
- 71
users/gourdo1/gourdo1.c View File

@ -1,5 +1,5 @@
/* Copyright 2021 Jonavin Eng @Jonavin
Copyright 2022 gourdo1 <jcblake@outlook.com>
Copyright 2022 gourdo1 <gourdo1@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -39,15 +39,17 @@ void dance_LSFT_reset(qk_tap_dance_state_t * state, void * user_data) {
unregister_code16(KC_LSFT);
}
}
#endif // TD_LSFT_CAPSLOCK_ENABLE
// Tap Dance definitions
qk_tap_dance_action_t tap_dance_actions[] = {
#ifdef TD_LSFT_CAPSLOCK_ENABLE
// Tap once for shift, twice for Caps Lock
[TD_LSFT_CAPSLOCK] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
[TD_LSFT_CAPS_WIN] = ACTION_TAP_DANCE_FN_ADVANCED(dance_LSFT_each_tap, NULL, dance_LSFT_reset),
#endif // TD_LSFT_CAPSLOCK_ENABLE
// Tap once for Escape, twice to reset to base layer
[TD_ESC_BASELYR] = ACTION_TAP_DANCE_DUAL_ROLE(KC_ESC, _BASE),
[TD_ESC_BASELYR] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _BASE)
};
#endif // TD_LSFT_CAPSLOCK_ENABLE
// RGB NIGHT MODE
#ifdef RGB_MATRIX_ENABLE
@ -134,10 +136,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
return false;
}
// Your macros ...
// Key macros ...
switch (keycode) {
// DotCom domain macros
// DotCom domain macros
case DOTCOM:
if (record -> event.pressed) {
SEND_STRING(".com");
@ -173,39 +175,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
// when keycode is released
}
break;
/*
case YAHOO:
if (record -> event.pressed) SEND_STRING("yahoo.com");
else unregister_code16(keycode);
break;
case OUTLOOK:
if (record -> event.pressed) SEND_STRING("outlook.com");
else unregister_code16(keycode);
break;
case GMAIL:
if (record -> event.pressed) SEND_STRING("gmail.com");
else unregister_code16(keycode);
break;
case HOTMAIL:
if (record -> event.pressed) {
SEND_STRING("hotmail.com");
} else unregister_code16(keycode);
break;
case DOTCOM:
if (record -> event.pressed) SEND_STRING(".com");
else unregister_code16(keycode);
break;
*/
// Windows key lock
// WinKey lock
case KC_WINLCK:
if (record -> event.pressed) {
keymap_config.no_gui = !keymap_config.no_gui; //toggle status
} else unregister_code16(keycode);
break;
// Double Zero
// Double Zero
case KC_00:
if (record -> event.pressed) {
// when keycode KC_00 is pressed
@ -213,7 +191,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
} else unregister_code16(keycode);
break;
// Treat Control+Space as if regular Space
// Treat Control+Space as if regular Space
case KC_SPC: {
// Initialize a boolean variable that keeps track of the space key status: registered or not?
static bool spckey_registered;
@ -239,8 +217,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
return false;
}
}
}
break;
}
break;
// Treat Shift+Space as if regular Space
case KC_SHIFTSPC: {
@ -268,8 +246,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
return false;
}
}
}
break;
}
break;
// Add INS as SHIFT-modified BackSpace key
case KC_BSPC: {
@ -297,38 +275,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t * record) {
return false;
}
}
}
break;
/* Add INS as SHIFT-modified DEL key
case KC_DEL: {
// Initialize a boolean variable that keeps track of the delete key status: registered or not?
static bool inskey_registered;
if (record->event.pressed) {
// Detect the activation of either shift keys
if (mod_state & MOD_MASK_SHIFT) {
// First temporarily canceling both shifts so that
// shift isn't applied to the KC_INS keycode
del_mods(MOD_MASK_SHIFT);
register_code(KC_INS);
// Update the boolean variable to reflect the status of KC_INS
inskey_registered = true;
// Reapplying modifier state so that the held shift key(s)
// still work even after having tapped the Delete/Insert key.
set_mods(mod_state);
return false;
}
} else { // on release of KC_DEL
// In case KC_INS is still being sent even after the release of KC_DEL
if (inskey_registered) {
unregister_code(KC_INS);
inskey_registered = false;
return false;
}
}
}
break;
*/
}
break;
#ifdef IDLE_TIMEOUT_ENABLE
case RGB_TOI:
@ -418,7 +366,6 @@ void activate_numlock(bool turn_on) {
}
// INITIAL STARTUP
__attribute__((weak)) void keyboard_post_init_keymap(void) {}
void keyboard_post_init_user(void) {
@ -427,6 +374,6 @@ void keyboard_post_init_user(void) {
activate_numlock(true); // turn on Num lock by default so that the numpad layer always has predictable results
#endif // STARTUP_NUMLOC_ON
#ifdef IDLE_TIMEOUT_ENABLE
timeout_timer = timer_read(); // set inital time for ide timeout
timeout_timer = timer_read(); // set initial time for idle timeout
#endif
}

+ 20
- 15
users/gourdo1/gourdo1.h View File

@ -1,5 +1,5 @@
/* Copyright 2021 Jonavin Eng @Jonavin
Copyright 2022 gourdo1 <jcblake@outlook.com>
Copyright 2022 gourdo1 <gourdo1@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -20,27 +20,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// DEFINE MACROS
#define ARRAYSIZE(arr) sizeof(arr) / sizeof(arr[0])
// LAYERS
// LAYERS -- Note: to avoid compile problems, make sure total layers matches DYNAMIC_KEYMAP_LAYER_COUNT defined in config.h (where _COLEMAK layer is defined)
enum custom_user_layers {
_BASE,
_FN1,
_NUMPADMOUSE,
_MOUSEKEY,
#ifdef GAME_ENABLE
_GAME
#endif //GAME_ENABLE
};
#define KC_CAD LALT(LCTL(KC_DEL))
#define LOCKPC LGUI(KC_L)
#define KC_AF4 LALT(KC_F4)
#define KC_TASK LCTL(LSFT(KC_ESC))
#define CT_PGUP RCTL(KC_PGUP)
#define CT_PGDN RCTL(KC_PGDN)
#define CT_HOME RCTL(KC_HOME)
#define CT_END RCTL(KC_END)
#define KC_SFTUP RSFT_T(KC_UP) // Shift when held, Up arrow when tapped
#define KC_RAISESPC LT(_MOUSEKEY, KC_SPC) // _MOUSEKEY layer mod when held, space when tapped
#define KC_SFTUP RSFT_T(KC_UP) // Shift when held, Up arrow when tapped
#define KC_RAISESPC LT(_MOUSEKEY, KC_SPC) // _MOUSEKEY layer mod when held, space when tapped
#define KC_LOWERSPC LT(_NUMPADMOUSE, KC_SPC) // _NUMPAD-MOUSE layer mod when held, space when tapped
#define KC_SHIFTSPC LSFT(KC_SPC)
#define SWAP_L SGUI(KC_LEFT) // Swap application to left display
#define SWAP_R SGUI(KC_RGHT) // Swap application to right display
#define SWAP_L SGUI(KC_LEFT) // Swap application to left display
#define SWAP_R SGUI(KC_RGHT) // Swap application to right display
// KEYCODES
enum custom_user_keycodes {
@ -66,25 +70,26 @@ enum custom_user_keycodes {
KC_TSTOG, // Tab Scroll Toggle
NEW_SAFE_RANGE // new safe range for keymap level custom keycodes
NEW_SAFE_RANGE // New safe range for keymap level custom keycodes
};
#ifdef TD_LSFT_CAPSLOCK_ENABLE
// Tap Dance Definitions
enum custom_tapdance {
TD_LSFT_CAPSLOCK,
#ifdef TD_LSFT_CAPSLOCK_ENABLE
TD_LSFT_CAPS_WIN,
#endif // TD_LSFT_CAPSLOCK_ENABLE
TD_ESC_BASELYR
};
#define KC_LSFTCAPS TD(TD_LSFT_CAPSLOCK)
#define KC_LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN)
#define KC_ESCLYR TD(TD_ESC_BASELYR)
#ifdef TD_LSFT_CAPSLOCK_ENABLE
#define KC_LSFTCAPSWIN TD(TD_LSFT_CAPS_WIN)
#else // regular Shift
#define KC_LSFTCAPS KC_LSFT
// regular Escape
#define KC_ESCLYR KC_ESC
#define KC_LSFTCAPSWIN KC_LSFT
#endif // TD_LSFT_CAPSLOCK_ENABLE
#define KC_ESCLYR TD(TD_ESC_BASELYR)
// ENCODER ACTIONS
#ifdef ENCODER_ENABLE
void encoder_action_volume(bool clockwise);


+ 2
- 2
users/gourdo1/gourdo1_encoder.c View File

@ -1,5 +1,5 @@
/* Copyright 2021 Jonavin Eng @Jonavin
Copyright 2022 gourdo1 <jcblake@outlook.com>
Copyright 2022 gourdo1 <gourdo1@outlook.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "gourdo1.h"
#ifdef ENCODER_ENABLE


Loading…
Cancel
Save