aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Blyumberg <nblyumberg@gmail.com>2020-05-09 17:52:58 -0400
committerGitHub <noreply@github.com>2020-05-09 22:52:58 +0100
commit179c868059734211add698857ca6d71bf9fd9c05 (patch)
treea3223b144a430eae40a2b99373cc11ff446ba0d6
parent7b11dcce106219cdbbbd3ea1e58891ab3dcffc67 (diff)
downloadqmk_firmware-179c868059734211add698857ca6d71bf9fd9c05.tar.gz
qmk_firmware-179c868059734211add698857ca6d71bf9fd9c05.zip
[Keymap] Add nblyumberg 1upkeyboards super16 keymap (#8902)
* Updated with my super16 version for my keypad * Added my folder to super16 * Set max LED brightness to 50% * Added custom keycodes for enter/shift+enter and copy/paste on one key * Fixed the boot up layer color * Renamed folder * Revert changes to root super16 files * Update keymap config.h and rules.mk files * Restore deleted 15game keymap files * Corrected the hold keycode for CCCV * Removed unnecessary comments * Update keyboards/1upkeyboards/super16/keymaps/nblyumberg/keymap.c Co-Authored-By: ridingqwerty <george.g.koenig@gmail.com> * Update keyboards/1upkeyboards/super16/keymaps/nblyumberg/config.h Co-Authored-By: ridingqwerty <george.g.koenig@gmail.com> * Update keyboards/1upkeyboards/super16/keymaps/nblyumberg/keymap.c Co-Authored-By: ridingqwerty <george.g.koenig@gmail.com> * Rewriting the layer color functionality * Revisions * Fixed the layer switching * Fixed the default layer color problem * Added a function suggested by Drashna but it won't compile * Cleaned up the code for PR * Removed unnecessary define for layer colors Co-authored-by: ridingqwerty <george.g.koenig@gmail.com>
-rw-r--r--keyboards/1upkeyboards/super16/keymaps/nblyumberg/config.h13
-rw-r--r--keyboards/1upkeyboards/super16/keymaps/nblyumberg/keymap.c127
-rw-r--r--keyboards/1upkeyboards/super16/keymaps/nblyumberg/readme.md6
-rw-r--r--keyboards/1upkeyboards/super16/keymaps/nblyumberg/rules.mk2
4 files changed, 148 insertions, 0 deletions
diff --git a/keyboards/1upkeyboards/super16/keymaps/nblyumberg/config.h b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/config.h
new file mode 100644
index 000000000..3d0351288
--- /dev/null
+++ b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/config.h
@@ -0,0 +1,13 @@
1#pragma once
2
3// Time out one shot layers after 3 seconds
4#define ONESHOT_TIMEOUT 3000
5
6#define RGBLED_NUM 16
7
8
9// Undef and redefine default brightness to half of 255
10#undef RGBLIGHT_LIMIT_VAL
11#define RGBLIGHT_LIMIT_VAL 128
12
13#define TAPPING_TERM 200
diff --git a/keyboards/1upkeyboards/super16/keymaps/nblyumberg/keymap.c b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/keymap.c
new file mode 100644
index 000000000..170d1ad8f
--- /dev/null
+++ b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/keymap.c
@@ -0,0 +1,127 @@
1#include QMK_KEYBOARD_H
2
3uint16_t copy_paste_timer;
4uint16_t enter_timer;
5
6extern rgblight_config_t rgblight_config;
7
8// Define custom keycodes
9enum my_keycodes {
10 KC_CCCV = SAFE_RANGE,
11 KC_2ENTER
12};
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15 //Layer 0 - Base Layer (F13 to F24, and One Shot Layer 1,2,3,4)
16 [0] = LAYOUT_ortho_4x4(
17 KC_F13, KC_F14, KC_F15, KC_F16,
18 KC_F17, KC_CCCV, KC_F19, KC_F20,
19 KC_F21, KC_F22, KC_F23, KC_2ENTER,
20 OSL(1), OSL(2), OSL(3), TG(4) //Transparent to let you go between layers
21 ),
22
23 [1] = LAYOUT_ortho_4x4(
24 LALT(KC_F13), LALT(KC_F14), LALT(KC_F15), LALT(KC_F16),
25 LALT(KC_F17), LALT(KC_F18), LALT(KC_F19), LALT(KC_F20),
26 LALT(KC_F21), LALT(KC_F22), LALT(KC_F23), LALT(KC_F24),
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
28 ),
29
30 //Layer 2 - Shift + Function Key Layer
31 [2] = LAYOUT_ortho_4x4(
32 LSFT(KC_F13), LSFT(KC_F14), LSFT(KC_F15), LSFT(KC_F16),
33 LSFT(KC_F17), LSFT(KC_F18), LSFT(KC_F19), LSFT(KC_F20),
34 LSFT(KC_F21), LSFT(KC_F22), LSFT(KC_F23), LSFT(KC_F24),
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
36 ),
37
38 //Layer 3 - Control + Function Key
39 [3] = LAYOUT_ortho_4x4(
40 LCTL(KC_F13), LCTL(KC_F14), LCTL(KC_F15), LCTL(KC_F16),
41 LCTL(KC_F17), LCTL(KC_F18), LCTL(KC_F19), LCTL(KC_F20),
42 LCTL(KC_F21), LCTL(KC_F22), LCTL(KC_F23), LCTL(KC_F24),
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
44 ),
45
46 //Layer 4 - Keyboard Lights. Programming and Special Functions
47 [4] = LAYOUT_ortho_4x4(
48 KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU,
49 RGB_TOG, RGB_MOD, RGB_RMOD, KC_MUTE,
50 TO(0), RESET, EEP_RST, KC_VOLD,
51 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
52 ),
53};
54
55
56bool process_record_user(uint16_t keycode, keyrecord_t *record) {
57 switch (keycode) {
58 case KC_CCCV: // One key copy/paste
59 if (record->event.pressed) {
60 copy_paste_timer = timer_read();
61 } else {
62 if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
63 tap_code16(LCTL(KC_C));
64 } else { // Tap, paste
65 tap_code16(LCTL(KC_V));
66 }
67 } return true;
68 case KC_2ENTER:
69 if (record->event.pressed) {
70 enter_timer = timer_read();
71 } else {
72 if (timer_elapsed(enter_timer) > TAPPING_TERM) { // Hold, shift+enter
73 tap_code16(LSFT(KC_ENTER));
74 } else { // Tap, enter
75 tap_code16(KC_F24);
76 }
77 }
78 return true;
79 default:
80 return true;
81 }
82}
83
84
85void keyboard_post_init_user(void) {
86 //Enable the LED layers
87 layer_state_set_user(layer_state);
88}
89
90layer_state_t layer_state_set_user(layer_state_t state) {
91 rgblight_sethsv_noeeprom(HSV_WHITE);
92 switch(get_highest_layer(state)) {
93 case 1:
94 // Green
95 rgblight_enable_noeeprom();
96 rgblight_sethsv_noeeprom(HSV_GREEN);
97 break;
98 case 2:
99 // Red
100 rgblight_enable_noeeprom();
101 rgblight_sethsv_noeeprom(HSV_RED);
102 break;
103 case 3:
104 // Blue
105 rgblight_enable_noeeprom();
106 rgblight_sethsv_noeeprom(HSV_BLUE);
107 break;
108 case 4:
109 // Orange
110 rgblight_enable_noeeprom();
111// rgblight_sethsv_noeeprom(HSV_PURPLE);
112 rgblight_sethsv_noeeprom(HSV_ORANGE);
113 break;
114 default:
115 // White
116 //Read RGB Light State
117 rgblight_config.raw = eeconfig_read_rgblight();
118 //If enabled, set white
119 if (rgblight_config.enable) {
120 rgblight_sethsv_noeeprom(HSV_WHITE);
121 } else { //Otherwise go back to disabled
122 rgblight_disable_noeeprom();
123 }
124 break;
125}
126return state;
127} \ No newline at end of file
diff --git a/keyboards/1upkeyboards/super16/keymaps/nblyumberg/readme.md b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/readme.md
new file mode 100644
index 000000000..5ae101b53
--- /dev/null
+++ b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/readme.md
@@ -0,0 +1,6 @@
1# Nick B's Super16 keymap
2
3A modification of the default keymap to include layer indicators with RGB
4* Added a time out of 3 seconds to 1 shot layers
5* Reduced brightness to half to reduce power draw
6* Added a one key copy/paste keycode
diff --git a/keyboards/1upkeyboards/super16/keymaps/nblyumberg/rules.mk b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/rules.mk
new file mode 100644
index 000000000..b5bd51b32
--- /dev/null
+++ b/keyboards/1upkeyboards/super16/keymaps/nblyumberg/rules.mk
@@ -0,0 +1,2 @@
1RGB_MATRIX_ENABLE = no
2RGBLIGHT_ENABLE = yes