aboutsummaryrefslogtreecommitdiff
path: root/keyboards/nullbitsco/nibble/keymaps/iso/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/nullbitsco/nibble/keymaps/iso/keymap.c')
-rw-r--r--keyboards/nullbitsco/nibble/keymaps/iso/keymap.c128
1 files changed, 128 insertions, 0 deletions
diff --git a/keyboards/nullbitsco/nibble/keymaps/iso/keymap.c b/keyboards/nullbitsco/nibble/keymaps/iso/keymap.c
new file mode 100644
index 000000000..46f246d6e
--- /dev/null
+++ b/keyboards/nullbitsco/nibble/keymaps/iso/keymap.c
@@ -0,0 +1,128 @@
1/* Copyright 2020 Jay Greco
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#define _MA 0
19#define _FN 1
20
21enum custom_keycodes {
22 KC_CUST = SAFE_RANGE,
23};
24
25const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
26 [_MA] = LAYOUT_iso(
27 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_TILD,
28 KC_F13, 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_DEL,
29 KC_F14, 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_NUHS, KC_ENT, KC_PGUP,
30 KC_F15, KC_LSFT, KC_NUBS, 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_PGDN,
31 KC_F16, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
32 ),
33 [_FN] = LAYOUT_iso(
34 RESET, 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_HOME, KC_INS,
35 RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
36 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
37 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
38 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
39 ),
40
41};
42
43bool process_record_user(uint16_t keycode, keyrecord_t *record) {
44 // Send keystrokes to host keyboard, if connected (see readme)
45 process_record_remote_kb(keycode, record);
46 switch(keycode) {
47 case KC_CUST: //custom macro
48 if (record->event.pressed) {
49 }
50 break;
51
52 case RM_1: //remote macro 1
53 if (record->event.pressed) {
54 }
55 break;
56
57 case RM_2: //remote macro 2
58 if (record->event.pressed) {
59 }
60 break;
61
62 case RM_3: //remote macro 3
63 if (record->event.pressed) {
64 }
65 break;
66
67 case RM_4: //remote macro 4
68 if (record->event.pressed) {
69 }
70 break;
71
72 }
73return true;
74}
75
76// RGB config, for changing RGB settings on non-VIA firmwares
77void change_RGB(bool clockwise) {
78 bool shift = get_mods() & MOD_MASK_SHIFT;
79 bool alt = get_mods() & MOD_MASK_ALT;
80 bool ctrl = get_mods() & MOD_MASK_CTRL;
81
82 if (clockwise) {
83 if (alt) {
84 rgblight_increase_hue();
85 } else if (ctrl) {
86 rgblight_increase_val();
87 } else if (shift) {
88 rgblight_increase_sat();
89 } else {
90 rgblight_step();
91 }
92
93 } else {
94 if (alt) {
95 rgblight_decrease_hue();
96 } else if (ctrl) {
97 rgblight_decrease_val();
98 } else if (shift) {
99 rgblight_decrease_sat();
100 } else {
101 rgblight_step_reverse();
102 }
103 }
104}
105
106void encoder_update_kb(uint8_t index, bool clockwise) {
107 if (layer_state_is(1)) {
108 //change RGB settings
109 change_RGB(clockwise);
110 }
111 else {
112 if (clockwise) {
113 tap_code(KC_VOLU);
114 } else {
115 tap_code(KC_VOLD);
116 }
117 }
118}
119
120void matrix_init_user(void) {
121 // Initialize remote keyboard, if connected (see readme)
122 matrix_init_remote_kb();
123}
124
125void matrix_scan_user(void) {
126 // Scan and parse keystrokes from remote keyboard, if connected (see readme)
127 matrix_scan_remote_kb();
128} \ No newline at end of file