Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New custom keymap for Glorious GMMK Pro ANSI layout #16199

Merged
merged 75 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
3749240
Initial commits using @Jonavin firmware as baseline
gourdo1 Feb 2, 2022
470ba9d
Added latest firmware binary and cheatsheet PDF
gourdo1 Feb 2, 2022
ca94182
Allow .bin file syncing
gourdo1 Feb 2, 2022
abd9e99
Moved Insert to Shift-Backspace so Shift-Delete still works in Window…
gourdo1 Feb 2, 2022
0283678
Merge branch 'qmk:master' into master
gourdo1 Feb 2, 2022
a194d90
Update kt60_m.c
gourdo1 Feb 2, 2022
0743ffb
Create readme.md
gourdo1 Feb 2, 2022
3789a4d
Update readme.md
gourdo1 Feb 2, 2022
aa9eafd
Update readme.md
gourdo1 Feb 2, 2022
61c005b
Merge branch 'qmk:master' into master
gourdo1 Feb 2, 2022
6aa523c
Merge branch 'qmk:master' into master
gourdo1 Feb 2, 2022
809bf65
GPL Copyright text updates
gourdo1 Feb 3, 2022
e41bb1e
readme updates
gourdo1 Feb 3, 2022
d0330bd
Update readme.md
gourdo1 Feb 4, 2022
04b9634
Update readme.md
gourdo1 Feb 4, 2022
02c7637
Merge branch 'qmk:master' into master
gourdo1 Feb 4, 2022
29ccc3d
Update readme.md
gourdo1 Feb 4, 2022
b9b50e6
changes to prepare for pull request
gourdo1 Feb 4, 2022
5606cac
Update readme.md
gourdo1 Feb 4, 2022
c41a27f
pdf link fix
gourdo1 Feb 4, 2022
d1c1511
Merge branch 'master' of https://github.com/gourdo1/qmk_firmware
gourdo1 Feb 4, 2022
144085c
Merge branch 'qmk:master' into master
gourdo1 Feb 4, 2022
6b9774b
Merge branch 'qmk:master' into PR-branch
gourdo1 Feb 4, 2022
2603f44
Delete GMMK_Pro_Cheatsheet.pdf
gourdo1 Feb 4, 2022
e9ef8a1
Update keyboards/gmmk/pro/ansi/keymaps/gourdo1/keymap.c
gourdo1 Feb 4, 2022
7f69017
Update keyboards/gmmk/pro/ansi/keymaps/gourdo1/keymap.c
gourdo1 Feb 4, 2022
646b00f
Update keyboards/gmmk/pro/ansi/keymaps/gourdo1/keymap.c
gourdo1 Feb 4, 2022
9c3bfdc
Made recommended changes to keymap.c
gourdo1 Feb 4, 2022
f0071f3
Update keymap.c
gourdo1 Feb 4, 2022
8d50ae2
Update keymap.c
gourdo1 Feb 4, 2022
c8425bd
Delete keymap.c
gourdo1 Feb 4, 2022
abb52fd
Merge branch 'PR-branch' of https://github.com/gourdo1/qmk_firmware i…
gourdo1 Feb 4, 2022
3bd3839
Delete keymap.c
gourdo1 Feb 4, 2022
9d37801
PR recommendations, formatting changes and default hsv updated in key…
gourdo1 Feb 5, 2022
1309a60
Re-formatting & RGB cleanup
gourdo1 Feb 5, 2022
1f504a2
fixed missing breaks in gourdo1.c + some cosmetic fixes
gourdo1 Feb 5, 2022
4745774
added RGB saturation shortcuts to FN layer
gourdo1 Feb 5, 2022
3236182
Updated FN layer RGB lighting
gourdo1 Feb 5, 2022
8812d08
Update readme.md
gourdo1 Feb 7, 2022
f93d2be
Update readme.md
gourdo1 Feb 7, 2022
4410a7d
Merge branch 'qmk:master' into PR-branch
gourdo1 Feb 8, 2022
9ffc707
first attempt to create exponential encoder volume
gourdo1 Feb 17, 2022
323c060
fixes to encoder
gourdo1 Feb 17, 2022
9520f48
Update readme.md
gourdo1 Feb 17, 2022
5a12a0d
Merge branch 'qmk:master' into encoder-test
gourdo1 Feb 17, 2022
3482f7c
Update readme.md
gourdo1 Feb 17, 2022
dde59ee
Merge branch 'qmk:master' into PR-branch
gourdo1 Feb 17, 2022
39c9fd1
Merge pull request #2 from gourdo1/encoder-test
gourdo1 Feb 17, 2022
b2adb74
Update readme.md
gourdo1 Feb 17, 2022
7810552
Merge branch 'PR-branch' of https://github.com/gourdo1/qmk_firmware i…
gourdo1 Feb 17, 2022
42928a5
Merge branch 'qmk:master' into PR-branch
gourdo1 Feb 17, 2022
f954ad4
Caps Word added
gourdo1 Feb 25, 2022
3e176e6
Merge branch 'qmk:master' into PR-branch
gourdo1 Feb 25, 2022
231259b
Merge branch 'qmk:master' into PR-branch
gourdo1 Feb 27, 2022
e3da1e6
Added double tap ESC to revert to base layer
gourdo1 Feb 27, 2022
c32d87d
Merge branch 'qmk:master' into PR-branch
gourdo1 Feb 28, 2022
3d02077
Merge branch 'qmk:master' into PR-branch
gourdo1 Mar 1, 2022
703ff6e
Update readme.md
gourdo1 Mar 1, 2022
43838e0
Merge branch 'qmk:master' into PR-branch
gourdo1 Mar 15, 2022
b18a701
Squashed commit of the following:
gourdo1 Mar 15, 2022
8049c1d
Added back VIA support
gourdo1 Mar 16, 2022
eb7a4e9
Merge branch 'qmk:master' into PR-branch
gourdo1 Mar 22, 2022
f3f36d7
Update readme.md
gourdo1 Mar 24, 2022
ec14a44
Update readme.md
gourdo1 Mar 30, 2022
3802941
Merge branch 'qmk:master' into PR-branch
gourdo1 Apr 7, 2022
7444680
Domain shortcuts added to keymap
gourdo1 Apr 7, 2022
a9ccdfe
domain macro fixes
gourdo1 Apr 7, 2022
2a474bf
Update gourdo1.c
gourdo1 Apr 7, 2022
112c327
Update readme.md
gourdo1 Apr 7, 2022
d995ee1
counteract pro.c changes to resolve encoder issues
gourdo1 Apr 7, 2022
6bdfe1e
Update readme.md
gourdo1 Apr 8, 2022
9799729
Add NKRO toggle on [Fn]+R
gourdo1 Apr 11, 2022
21d835f
Update readme.md
gourdo1 Apr 11, 2022
3792215
swap app test
gourdo1 Apr 11, 2022
9a2c274
Add EEPROM Clear capability to Fn-ESC; Update readme.md
gourdo1 Apr 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions keyboards/gmmk/pro/ansi/keymaps/gourdo1/caps_word.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
// Copyright 2021-2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
// For full documentation, see
// https://getreuer.info/posts/keyboards/caps-word

#include "caps_word.h"

static bool caps_word_active = false;

#if CAPS_WORD_IDLE_TIMEOUT > 0
#if CAPS_WORD_IDLE_TIMEOUT < 100 || CAPS_WORD_IDLE_TIMEOUT > 30000
// Constrain timeout to a sensible range. With the 16-bit timer, the longest
// representable timeout is 32768 ms, rounded here to 30000 ms = half a minute.
#error "caps_word: CAPS_WORD_IDLE_TIMEOUT must be between 100 and 30000 ms"
#endif

static uint16_t idle_timer = 0;

void caps_word_task(void) {
if (caps_word_active && timer_expired(timer_read(), idle_timer)) {
caps_word_set(false);
}
}
#endif // CAPS_WORD_IDLE_TIMEOUT > 0

bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
#ifndef NO_ACTION_ONESHOT
const uint8_t mods = get_mods() | get_oneshot_mods();
#else
const uint8_t mods = get_mods();
#endif // NO_ACTION_ONESHOT

if (!caps_word_active) {
// Pressing both shift keys at the same time enables caps word.
if ((mods & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) {
caps_word_set(true); // Activate Caps Word.
return false;
}
return true;
} else {
#if CAPS_WORD_IDLE_TIMEOUT > 0
idle_timer = record->event.time + CAPS_WORD_IDLE_TIMEOUT;
#endif // CAPS_WORD_IDLE_TIMEOUT > 0
}

if (!record->event.pressed) { return true; }

if (!(mods & ~MOD_MASK_SHIFT)) {
switch (keycode) {
// Ignore MO, TO, TG, TT, and OSL layer switch keys.
case QK_MOMENTARY ... QK_MOMENTARY_MAX:
case QK_TO ... QK_TO_MAX:
case QK_TOGGLE_LAYER ... QK_TOGGLE_LAYER_MAX:
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
case QK_ONE_SHOT_LAYER ... QK_ONE_SHOT_LAYER_MAX:
return true;

#ifndef NO_ACTION_TAPPING
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
if (record->tap.count == 0) {
// Deactivate if a mod becomes active through holding a mod-tap key.
caps_word_set(false);
return true;
}
keycode &= 0xff;
break;

#ifndef NO_ACTION_LAYER
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
#endif // NO_ACTION_LAYER
if (record->tap.count == 0) { return true; }
keycode &= 0xff;
break;
#endif // NO_ACTION_TAPPING

#ifdef SWAP_HANDS_ENABLE
case QK_SWAP_HANDS ... QK_SWAP_HANDS_MAX:
if (keycode > 0x56F0 || record->tap.count == 0) { return true; }
keycode &= 0xff;
break;
#endif // SWAP_HANDS_ENABLE
}

if (caps_word_press_user(keycode)) {
return true;
}
}

caps_word_set(false); // Deactivate Caps Word.
return true;
}

void caps_word_set(bool active) {
if (active != caps_word_active) {
if (active) {
clear_mods();
#ifndef NO_ACTION_ONESHOT
clear_oneshot_mods();
#endif // NO_ACTION_ONESHOT
#if CAPS_WORD_IDLE_TIMEOUT > 0
idle_timer = timer_read() + CAPS_WORD_IDLE_TIMEOUT;
#endif // CAPS_WORD_IDLE_TIMEOUT > 0
} else if ((get_weak_mods() & MOD_BIT(KC_LSFT)) != 0) {
// If the weak shift mod is still on, turn it off and send an update to
// the host computer.
del_weak_mods(MOD_BIT(KC_LSFT));
send_keyboard_report();
}

caps_word_active = active;
caps_word_set_user(active);
}
}

bool caps_word_get(void) { return caps_word_active; }

__attribute__((weak)) void caps_word_set_user(bool active) {}

__attribute__((weak)) bool caps_word_press_user(uint16_t keycode) {
switch (keycode) {
// Keycodes that continue Caps Word, with shift applied.
case KC_A ... KC_Z:
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key.
return true;

// Keycodes that continue Caps Word, without shifting.
case KC_1 ... KC_0:
case KC_BSPC:
case KC_MINS:
case KC_UNDS:
return true;

default:
return false; // Deactivate Caps Word.
}
}

127 changes: 127 additions & 0 deletions keyboards/gmmk/pro/ansi/keymaps/gourdo1/caps_word.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Copyright 2021-2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
// Caps Word, activated by pressing both shift keys at the same time.
//
// This library implements "Caps Word", which is like conventional Caps Lock,
// but automatically disables itself at the end of the word. This is useful for
// typing all-caps identifiers like `MOD_MASK_ALT`.
//
// Caps Word is activated by pressing the left and right shift keys at the same
// time. This way you don't need a dedicated key for using Caps Word. I've
// tested that this works as expected with one-shot mods and Space Cadet Shift.
// If your shift keys are mod-taps, activate Caps Word by holding both shift
// mod-tap keys until the tapping term, release them, then begin typing.
//
// Optionally, Caps Word may be configured to deactivate if the keyboard is idle
// for some time. This is useful to mitigate unintended shifting when you get
// interrupted or switch to the mouse while Caps Word is active. In your
// config.h, define `CAPS_WORD_IDLE_TIMEOUT` with a time in milliseconds:
//
// #define CAPS_WORD_IDLE_TIMEOUT 5000 // Turn off Caps Word after 5 seconds.
//
// and in your keymap.c, define (or add to) `matrix_scan_user()` as
//
// void matrix_scan_user(void) {
// caps_word_task();
// // Other tasks...
// }
//
// For full documentation, see
// https://getreuer.info/posts/keyboards/caps-word

#pragma once

#include QMK_KEYBOARD_H

// Call this function from `process_record_user()` to implement Caps Word.
bool process_caps_word(uint16_t keycode, keyrecord_t* record);

// If CAPS_WORD_IDLE_TIMEOUT is set, call `caps_word_task()` from
// `matrix_scan_user()` as described above.
//
// If CAPS_WORD_IDLE_TIMEOUT isn't set, calling this function has no effect (but
// will still compile).
#if CAPS_WORD_IDLE_TIMEOUT > 0
void caps_word_task(void);
#else
static inline void caps_word_task(void) {}
#endif

// Activates or deactivates Caps Word. For instance activate Caps Word with a
// combo by defining a `COMBO_ACTION` that calls `caps_word_set(true)`:
//
// void process_combo_event(uint16_t combo_index, bool pressed) {
// switch(combo_index) {
// case CAPS_COMBO:
// if (pressed) {
// caps_word_set(true); // Activate Caps Word.
// }
// break;
//
// // Other combos...
// }
// }
void caps_word_set(bool active);

// Returns whether Caps Word is currently active.
bool caps_word_get(void);

// An optional callback that gets called when Caps Word turns on or off. This is
// useful to represent the current Caps Word state, e.g. by setting an LED or
// playing a sound. In your keymap, define
//
// void caps_word_set_user(bool active) {
// if (active) {
// // Do something when Caps Word activates.
// } else {
// // Do something when Caps Word deactivates.
// }
// }
void caps_word_set_user(bool active);

// An optional callback which is called on every key press while Caps Word is
// active. When the key should be shifted (that is, a letter key), the callback
// should call `add_weak_mods(MOD_BIT(KC_LSFT))` to shift the key. The callback
// also determines whether the key should continue Caps Word. Returning true
// continues the current "word", while returning false is "word breaking" and
// deactivates Caps Word. The default callback is
//
// bool caps_word_press_user(uint16_t keycode) {
// switch (keycode) {
// // Keycodes that continue Caps Word, with shift applied.
// case KC_A ... KC_Z:
// add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to the next key.
// return true;
//
// // Keycodes that continue Caps Word, without shifting.
// case KC_1 ... KC_0:
// case KC_BSPC:
// case KC_MINS:
// case KC_UNDS:
// return true;
//
// default:
// return false; // Deactivate Caps Word.
// }
// }
//
// To customize, copy the above function into your keymap and add/remove
// keycodes to the above cases.
//
// NOTE: Outside of this callback, you can use `caps_word_set(false)` to
// deactivate Caps Word.
bool caps_word_press_user(uint16_t keycode);

75 changes: 75 additions & 0 deletions keyboards/gmmk/pro/ansi/keymaps/gourdo1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* Copyright 2021 Jonavin Eng @Jonavin
Copyright 2022 gourdo1 <[email protected]>

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/>.
*/

#pragma once

#define TAPPING_TOGGLE 2
// TT set to two taps

/* Handle GRAVESC combo keys */
#define GRAVE_ESC_ALT_OVERRIDE
// Always send Escape if Alt is pressed
#define GRAVE_ESC_CTRL_OVERRIDE
// Always send Escape if Control is pressed

// #define TAPPING_TERM 180
#define TAPPING_TERM 300
#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

// 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)

// add fifth 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
#endif // COLEMAK_LAYER_ENABLE

/*
// Mouse Keys Accelerated Mode Definitions
#define MOUSEKEY_DELAY 3 // Delay between pressing a movement key and cursor movement (default: 10)
#define MOUSEKEY_INTERVAL 13 // Time between cursor movements in milliseconds (default: 20); Try setting to 1000/monitor refresh for smooth movement.
#define MOUSEKEY_MOVE_DELTA 8 // Step size (default: 8)
#define MOUSEKEY_MAX_SPEED 9 // Maximum cursor speed at which acceleration stops (default: 10)
#define MOUSEKEY_TIME_TO_MAX 150 // Time until maximum cursor speed is reached (default: 30)
#define MOUSEKEY_WHEEL_DELAY 0 // Delay between pressing a wheel key and wheel movement (default: 10)
#define MOUSEKEY_WHEEL_INTERVAL 80 // Time between wheel movements (default: 80)
#define MOUSEKEY_WHEEL_MAX_SPEED 8 // Maximum number of scroll steps per scroll action (default: 8)
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 // Time until maximum scroll speed is reached (default: 40)
*/

// Mouse Keys Kinetic Mode Definitions
#define MK_KINETIC_SPEED // Enable Kinetic mode: Uses a quadratic curve on cursor speed to allow precise movements at the beginning and increases speed thereafter.
#define MOUSEKEY_DELAY 3 // Delay between pressing a movement key and cursor movement (default: 10)
#define MOUSEKEY_INTERVAL 13 // Time between cursor movements in milliseconds (default: 20); Try setting to 1000/monitor refresh for smooth movement.
#define MOUSEKEY_MOVE_DELTA 5 // Step size for accelerating from initial to base speed (default: 8)
#define MOUSEKEY_MOVE_MAX 50 // use instead of BASE SPEED to limit speed in Kinetic mode
#define MOUSEKEY_INITIAL_SPEED 100 // Initial speed of the cursor in pixels per second (default: 100)
//#define MOUSEKEY_BASE_SPEED 800 // (broken in QMK 0.16.0) Maximum cursor speed at which acceleration stops (default: 1000)
#define MOUSEKEY_DECELERATED_SPEED 400 // Decelerated cursor speed (default: 400)
#define MOUSEKEY_ACCELERATED_SPEED 2000 // Accelerated cursor speed (default: 3000)
#define MOUSEKEY_WHEEL_INITIAL_MOVEMENTS 16 // Initial number of movements of the mouse wheel (default: 16)
#define MOUSEKEY_WHEEL_BASE_MOVEMENTS 32 // Maximum number of movements at which acceleration stops (default: 32)
#define MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS 48 // Accelerated wheel movements (default: 48)
#define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8 // Decelerated wheel movements (default: 8)
Loading