diff options
| author | r-pufky <r-pufky@users.noreply.github.com> | 2020-11-25 10:05:01 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-25 10:05:01 -0800 |
| commit | 8897ab9b111b107cfcb08478ba0b4176432ea5b6 (patch) | |
| tree | b0595246e9a6f627442b6f0df90a5ceaf0d6c19a | |
| parent | 50611bd814beb4127378000ff398eaa475527cc5 (diff) | |
| download | qmk_firmware-8897ab9b111b107cfcb08478ba0b4176432ea5b6.tar.gz qmk_firmware-8897ab9b111b107cfcb08478ba0b4176432ea5b6.zip | |
[Keymap] Add personal massdrop/ctrl:r-pufky keymap. (#10887)
* Add personal massdrop/ctrl:r-pufky keymap.
* Added personal keymap per: https://docs.qmk.fm/#/contributing?id=keymaps
* Update massdrop/ctrl:r-pufky per review.
* Trimmed config.h
* Remove rules.mk
* Add copyright header to keymap.c
* Rename README.md to readme.md
* Remove files/lines per review.
* Removed keyboard-layout-editor.com json layouts.
* Removed keymap_config line.
| -rw-r--r-- | keyboards/massdrop/ctrl/keymaps/r-pufky/config.h | 27 | ||||
| -rw-r--r-- | keyboards/massdrop/ctrl/keymaps/r-pufky/keymap.c | 138 | ||||
| -rw-r--r-- | keyboards/massdrop/ctrl/keymaps/r-pufky/readme.md | 33 |
3 files changed, 198 insertions, 0 deletions
diff --git a/keyboards/massdrop/ctrl/keymaps/r-pufky/config.h b/keyboards/massdrop/ctrl/keymaps/r-pufky/config.h new file mode 100644 index 000000000..bd9c0ae2b --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/r-pufky/config.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2015 Jun Wako <wakojun@gmail.com> | ||
| 3 | |||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #pragma once | ||
| 19 | |||
| 20 | #include "config_common.h" | ||
| 21 | |||
| 22 | #define FORCE_NKRO | ||
| 23 | |||
| 24 | #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR | ||
| 25 | #define RGB_MATRIX_STARTUP_VAL 100 | ||
| 26 | #define RGB_BACKLIGHT_COLOR_1 RGB_BLUE | ||
| 27 | #define RGB_BACKLIGHT_COLOR_2 RGB_BLUE | ||
diff --git a/keyboards/massdrop/ctrl/keymaps/r-pufky/keymap.c b/keyboards/massdrop/ctrl/keymaps/r-pufky/keymap.c new file mode 100644 index 000000000..718338a4c --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/r-pufky/keymap.c | |||
| @@ -0,0 +1,138 @@ | |||
| 1 | /* Copyright 2020 Robert Pufky <rpufky@gmail.com> | ||
| 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 | enum ctrl_keycodes { | ||
| 20 | U_T_AUTO = SAFE_RANGE, // USB Extra Port Toggle Auto Detect / Always Active | ||
| 21 | U_T_AGCR, // USB Toggle Automatic GCR control | ||
| 22 | DBG_TOG, // DEBUG Toggle On / Off | ||
| 23 | DBG_MTRX, // DEBUG Toggle Matrix Prints | ||
| 24 | DBG_KBD, // DEBUG Toggle Keyboard Prints | ||
| 25 | DBG_MOU, // DEBUG Toggle Mouse Prints | ||
| 26 | MD_BOOT, // Restart into bootloader after hold timeout | ||
| 27 | }; | ||
| 28 | |||
| 29 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 30 | [0] = LAYOUT( | ||
| 31 | KC_ESC, 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_PSCR, KC_SLCK, KC_PAUS, | ||
| 32 | 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_INS, KC_HOME, KC_PGUP, | ||
| 33 | 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_DEL, KC_END, KC_PGDN, | ||
| 34 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
| 35 | 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, | ||
| 36 | KC_NLCK, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_F24, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT | ||
| 37 | ), | ||
| 38 | [1] = LAYOUT( | ||
| 39 | KC_EJCT, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_MUTE, _______, _______, | ||
| 40 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, | ||
| 41 | _______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, | ||
| 42 | KC_CAPS, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, | ||
| 43 | _______, RGB_TOG, _______, _______, _______, MD_BOOT, NK_TOGG, _______, _______, _______, _______, _______, KC_BRIU, | ||
| 44 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MRWD, KC_BRID, KC_MFFD | ||
| 45 | ), | ||
| 46 | }; | ||
| 47 | |||
| 48 | // Runs just one time when the keyboard initializes. | ||
| 49 | void matrix_init_user(void) { | ||
| 50 | // https://old.reddit.com/r/MechanicalKeyboards/comments/by8zv9/editing_rgb_backlighting_with_qmk/ | ||
| 51 | // https://docs.qmk.fm/#/feature_rgblight?id=colors | ||
| 52 | rgblight_sethsv(HSV_BLUE); | ||
| 53 | // Disable underglow by default | ||
| 54 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); | ||
| 55 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 56 | }; | ||
| 57 | |||
| 58 | // Runs constantly in the background, in a loop. | ||
| 59 | void matrix_scan_user(void) { | ||
| 60 | }; | ||
| 61 | |||
| 62 | #define MODS_SHIFT (get_mods() & MOD_MASK_SHIFT) | ||
| 63 | #define MODS_CTRL (get_mods() & MOD_MASK_CTRL) | ||
| 64 | #define MODS_ALT (get_mods() & MOD_MASK_ALT) | ||
| 65 | |||
| 66 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 67 | static uint32_t key_timer; | ||
| 68 | |||
| 69 | switch (keycode) { | ||
| 70 | case U_T_AUTO: | ||
| 71 | if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { | ||
| 72 | TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); | ||
| 73 | } | ||
| 74 | return false; | ||
| 75 | case U_T_AGCR: | ||
| 76 | if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { | ||
| 77 | TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); | ||
| 78 | } | ||
| 79 | return false; | ||
| 80 | case DBG_TOG: | ||
| 81 | if (record->event.pressed) { | ||
| 82 | TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); | ||
| 83 | } | ||
| 84 | return false; | ||
| 85 | case DBG_MTRX: | ||
| 86 | if (record->event.pressed) { | ||
| 87 | TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); | ||
| 88 | } | ||
| 89 | return false; | ||
| 90 | case DBG_KBD: | ||
| 91 | if (record->event.pressed) { | ||
| 92 | TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); | ||
| 93 | } | ||
| 94 | return false; | ||
| 95 | case DBG_MOU: | ||
| 96 | if (record->event.pressed) { | ||
| 97 | TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); | ||
| 98 | } | ||
| 99 | return false; | ||
| 100 | case MD_BOOT: | ||
| 101 | if (record->event.pressed) { | ||
| 102 | key_timer = timer_read32(); | ||
| 103 | } else { | ||
| 104 | if (timer_elapsed32(key_timer) >= 500) { | ||
| 105 | reset_keyboard(); | ||
| 106 | } | ||
| 107 | } | ||
| 108 | return false; | ||
| 109 | case RGB_TOG: | ||
| 110 | if (record->event.pressed) { | ||
| 111 | switch (rgb_matrix_get_flags()) { | ||
| 112 | case LED_FLAG_ALL: { | ||
| 113 | rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER); | ||
| 114 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 115 | } | ||
| 116 | break; | ||
| 117 | case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: { | ||
| 118 | rgb_matrix_set_flags(LED_FLAG_UNDERGLOW); | ||
| 119 | rgb_matrix_set_color_all(0, 0, 0); | ||
| 120 | } | ||
| 121 | break; | ||
| 122 | case LED_FLAG_UNDERGLOW: { | ||
| 123 | rgb_matrix_set_flags(LED_FLAG_NONE); | ||
| 124 | rgb_matrix_disable_noeeprom(); | ||
| 125 | } | ||
| 126 | break; | ||
| 127 | default: { | ||
| 128 | rgb_matrix_set_flags(LED_FLAG_ALL); | ||
| 129 | rgb_matrix_enable_noeeprom(); | ||
| 130 | } | ||
| 131 | break; | ||
| 132 | } | ||
| 133 | } | ||
| 134 | return false; | ||
| 135 | default: | ||
| 136 | return true; //Process all other keycodes normally | ||
| 137 | } | ||
| 138 | } | ||
diff --git a/keyboards/massdrop/ctrl/keymaps/r-pufky/readme.md b/keyboards/massdrop/ctrl/keymaps/r-pufky/readme.md new file mode 100644 index 000000000..28c6f153d --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/r-pufky/readme.md | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # Massdrop Ctrl r-pufky | ||
| 2 | |||
| 3 | Gaming QOL improvments; enabling useful keys for left hand & in-game overlay usage. | ||
| 4 | |||
| 5 | ## Layers | ||
| 6 | |||
| 7 | ### Typing Layer | ||
| 8 | |||
| 9 |  | ||
| 10 | |||
| 11 | Layer optimized to enable useful keys for gaming without changing typing state, as well as specific | ||
| 12 | in-game overlay keys. | ||
| 13 | |||
| 14 | * Left Ctrl: Easier control key usage without always setting capslock. | ||
| 15 | * Num Lock: Unique non visible character key for additional left-hand input options in game. | ||
| 16 | * Fn: Enable layer 1, temporal. | ||
| 17 | * F24: Unique non-visible F24 key; no windows function. Map to in-game overlays. | ||
| 18 | |||
| 19 | ### Function Layer | ||
| 20 | |||
| 21 |  | ||
| 22 | |||
| 23 | * Purple: Media keys. Note CD Eject on Escape, and OSX Prev/Next on Arrows. | ||
| 24 | * Blue: Keyboard adminstration. Toggle NKRO (N Key Rollover) and enable bootloader. | ||
| 25 | * Orange: RGB Controls. | ||
| 26 | * Red: Danger can break things! USB autodetect (always on) and USB GCR Auto control. | ||
| 27 | * Capslock: Now requires the use of the function key. | ||
| 28 | * F13-F14: Extended function keys. | ||
| 29 | * Bright+/-: Monitor Brightness. | ||
| 30 | |||
| 31 | ## GCR | ||
| 32 | GCR is the Global Current Register. Holds the value for current delivered to the LEDs, it's 165 | ||
| 33 | default and has range 0-255. This should be auto managed. | ||
