annotate keymap.c @ 5:eea4ee4ebb93 draft

- move back cursor keys to _RAISE layer
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 18 Feb 2019 13:13:40 +0900
parents 7e09639847e1
children 7b9e0c974769
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
1 #include QMK_KEYBOARD_H
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
2 #include "bootloader.h"
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
3 #ifdef PROTOCOL_LUFA
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
4 #include "lufa.h"
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
5 #include "split_util.h"
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
6 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
7 #ifdef SSD1306OLED
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
8 #include "ssd1306.h"
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
9 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
10
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
11 extern keymap_config_t keymap_config;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
12
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
13 #ifdef RGBLIGHT_ENABLE
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
14 //Following line allows macro to read current RGB settings
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
15 extern rgblight_config_t rgblight_config;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
16 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
17
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
18 extern uint8_t is_master;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
19
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
20 // Each layer gets a name for readability, which is then used in the keymap matrix below.
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
21 // The underscores don't mean anything - you can have a layer called STUFF or any other name.
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
22 // Layer names don't all need to be of the same length, obviously, and you can also skip them
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
23 // entirely and just use numbers.
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
24 #define _QWERTY 0
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
25 #define _MAC 1
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
26 #define _LOWER 3
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
27 #define _RAISE 4
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
28 #define _ADJUST 16
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
29
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
30 enum custom_keycodes {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
31 QWERTY = SAFE_RANGE,
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
32 LOWER,
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
33 RAISE,
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
34 ADJUST,
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
35 BACKLIT,
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
36 RGBRST,
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
37 RTAB,
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
38 LTAB,
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
39 RSPC,
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
40 LSPC,
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
41 USPC,
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
42 DSPC,
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
43 SSCR,
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
44 SWIN,
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
45 NAPP,
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
46 NWIN
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
47 };
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
48
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
49 enum macro_keycodes {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
50 KC_SAMPLEMACRO,
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
51 };
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
52
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
53 #define KC______ KC_TRNS
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
54 #define KC_XXXXX KC_NO
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
55 #define KC_LOWER LOWER
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
56 #define KC_RAISE RAISE
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
57 #define KC_RST RESET
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
58 #define KC_LRST RGBRST
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
59 #define KC_LTOG RGB_TOG
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
60 #define KC_LHUI RGB_HUI
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
61 #define KC_LHUD RGB_HUD
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
62 #define KC_LSAI RGB_SAI
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
63 #define KC_LSAD RGB_SAD
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
64 #define KC_LVAI RGB_VAI
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
65 #define KC_LVAD RGB_VAD
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
66 #define KC_LMOD RGB_MOD
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
67 #define KC_CTLTB CTL_T(KC_TAB)
3
4bc0df3a6934 - assign tab to basic layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
68 #define KC_CLESC CTL_T(KC_ESC)
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
69 #define KC_GUIEI GUI_T(KC_LANG2)
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
70 #define KC_ALTKN ALT_T(KC_LANG1)
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
71
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
72 #define KC_RTAB RTAB
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
73 #define KC_LTAB LTAB
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
74 #define KC_RSPC RSPC
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
75 #define KC_LSPC LSPC
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
76 #define KC_USPC USPC
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
77 #define KC_DSPC DSPC
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
78 #define KC_SSCR SSCR
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
79 #define KC_SWIN SWIN
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
80 #define KC_NAPP NAPP
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
81 #define KC_NWIN NWIN
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
82
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
83
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
84
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
85 #define SS_RGUI(string) SS_DOWN(X_RGUI) string SS_UP(X_RGUI)
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
86
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
87
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
88 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
89 [_QWERTY] = LAYOUT_kc( \
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
90 //,-----------------------------------------. ,-----------------------------------------.
3
4bc0df3a6934 - assign tab to basic layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
91 TAB, Q, W, E, R, T, Y, U, I, O, P, MINS,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
92 //|------+------+------+------+------+------| |------+------+------+------+------+------|
3
4bc0df3a6934 - assign tab to basic layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
93 CLESC, A, S, D, F, G, H, J, K, L, SCLN, QUOT,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
94 //|------+------+------+------+------+------| |------+------+------+------+------+------|
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
95 LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT,\
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
96 //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
97 LOWER, SPC, LALT, ENT, BSPC, RAISE \
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
98 //`--------------------' `--------------------'
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
99 ),
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
100
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
101 [_MAC] = LAYOUT_kc( \
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
102 //,-----------------------------------------. ,-----------------------------------------.
3
4bc0df3a6934 - assign tab to basic layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
103 TAB, Q, W, E, R, T, Y, U, I, O, P, MINS,\
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
104 //|------+------+------+------+------+------| |------+------+------+------+------+------|
3
4bc0df3a6934 - assign tab to basic layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 2
diff changeset
105 CLESC, A, S, D, F, G, H, J, K, L, SCLN, QUOT,\
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
106 //|------+------+------+------+------+------| |------+------+------+------+------+------|
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
107 LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT,\
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
108 //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
109 LOWER, SPC, LGUI, ENT, BSPC, RAISE \
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
110 //`--------------------' `--------------------'
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
111 ),
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
112
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
113 [_LOWER] = LAYOUT_kc( \
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
114 //,-----------------------------------------. ,-----------------------------------------.
4
7e09639847e1 - add mouse emulation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
115 PLUS, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, BSLS,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
116 //|------+------+------+------+------+------| |------+------+------+------+------+------|
5
eea4ee4ebb93 - move back cursor keys to _RAISE layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4
diff changeset
117 CTLTB, LTAB, RTAB, LSPC, RSPC, USPC, XXXXX, LCBR, RCBR, LBRC, RBRC, PIPE,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
118 //|------+------+------+------+------+------| |------+------+------+------+------+------|
5
eea4ee4ebb93 - move back cursor keys to _RAISE layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4
diff changeset
119 LSFT, GRV, TILD, XXXXX, XXXXX, DSPC, XXXXX, LT, GT, LCBR, RCBR, RSFT,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
120 //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
121 LOWER, SPC, LALT, ENT, BSPC, RAISE \
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
122 //`--------------------' `--------------------'
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
123 ),
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
124
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
125 [_RAISE] = LAYOUT_kc( \
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
126 //,-----------------------------------------. ,-----------------------------------------.
5
eea4ee4ebb93 - move back cursor keys to _RAISE layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4
diff changeset
127 EQL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSLS,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
128 //|------+------+------+------+------+------| |------+------+------+------+------+------|
5
eea4ee4ebb93 - move back cursor keys to _RAISE layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4
diff changeset
129 CTLTB, XXXXX, WH_U, MS_U, WH_D, BTN1, HOME, PGUP, UP, PGDN, XXXXX, PIPE,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
130 //|------+------+------+------+------+------| |------+------+------+------+------+------|
5
eea4ee4ebb93 - move back cursor keys to _RAISE layer
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 4
diff changeset
131 LSFT, BTN3, MS_L, MS_D, MS_R, BTN2, END, LEFT, DOWN, RIGHT, XXXXX, RSFT,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
132 //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
133 LOWER, SPC, LALT, ENT, BSPC, RAISE \
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
134 //`--------------------' `--------------------'
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
135 ),
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
136
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
137 [_ADJUST] = LAYOUT_kc( \
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
138 //,-----------------------------------------. ,-----------------------------------------.
4
7e09639847e1 - add mouse emulation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
139 F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
140 //|------+------+------+------+------+------| |------+------+------+------+------+------|
4
7e09639847e1 - add mouse emulation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
141 XXXXX, SSCR, SWIN, XXXXX, XXXXX, XXXXX, XXXXX, MUTE, VOLD, VOLU, XXXXX, XXXXX,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
142 //|------+------+------+------+------+------| |------+------+------+------+------+------|
4
7e09639847e1 - add mouse emulation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
143 RST, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, MRWD, MPLY, MFFD, XXXXX, RST,\
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
144 //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
145 LOWER, SPC, LALT, ENT, BSPC, RAISE \
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
146 //`--------------------' `--------------------'
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
147 )
4
7e09639847e1 - add mouse emulation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
148
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
149 #if 0
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
150 [_MAC] = LAYOUT_kc( \
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
151 //,-----------------------------------------. ,-----------------------------------------.
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
152 _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____,\
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
153 //|------+------+------+------+------+------| |------+------+------+------+------+------|
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
154 _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____,\
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
155 //|------+------+------+------+------+------| |------+------+------+------+------+------|
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
156 _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____,\
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
157 //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
158 _____, _____, LGUI, _____, _____, _____,\
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
159 //`--------------------' `--------------------'
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
160 )
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
161 #endif
4
7e09639847e1 - add mouse emulation
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 3
diff changeset
162
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
163 };
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
164
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
165 int RGB_current_mode;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
166
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
167 void persistent_default_layer_set(uint16_t default_layer) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
168 eeconfig_update_default_layer(default_layer);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
169 default_layer_set(default_layer);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
170 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
171
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
172 // Setting ADJUST layer RGB back to default
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
173 void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
174 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
175 layer_on(layer3);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
176 } else {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
177 layer_off(layer3);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
178 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
179 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
180
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
181 void matrix_init_user(void) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
182 #ifdef RGBLIGHT_ENABLE
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
183 RGB_current_mode = rgblight_config.mode;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
184 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
185 //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
186 #ifdef SSD1306OLED
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
187 iota_gfx_init(!has_usb()); // turns on the display
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
188 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
189 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
190
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
191 //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
192 #ifdef SSD1306OLED
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
193
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
194 // When add source files to SRC in rules.mk, you can use functions.
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
195 const char *read_layer_state(void);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
196 const char *read_logo(void);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
197 void set_keylog(uint16_t keycode, keyrecord_t *record);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
198 const char *read_keylog(void);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
199 const char *read_keylogs(void);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
200
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
201 // const char *read_mode_icon(bool swap);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
202 // const char *read_host_led_state(void);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
203 // void set_timelog(void);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
204 // const char *read_timelog(void);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
205
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
206 void matrix_scan_user(void) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
207 iota_gfx_task();
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
208 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
209
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
210 void matrix_render_user(struct CharacterMatrix *matrix) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
211 if (is_master) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
212 // If you want to change the display of OLED, you need to change here
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
213 matrix_write_ln(matrix, read_layer_state());
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
214 matrix_write_ln(matrix, read_keylog());
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
215 matrix_write_ln(matrix, read_keylogs());
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
216 //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
217 //matrix_write_ln(matrix, read_host_led_state());
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
218 //matrix_write_ln(matrix, read_timelog());
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
219 } else {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
220 matrix_write(matrix, read_logo());
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
221 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
222 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
223
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
224 void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
225 if (memcmp(dest->display, source->display, sizeof(dest->display))) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
226 memcpy(dest->display, source->display, sizeof(dest->display));
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
227 dest->dirty = true;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
228 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
229 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
230
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
231 void iota_gfx_task_user(void) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
232 struct CharacterMatrix matrix;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
233 matrix_clear(&matrix);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
234 matrix_render_user(&matrix);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
235 matrix_update(&display, &matrix);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
236 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
237 #endif//SSD1306OLED
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
238
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
239 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
240 if (record->event.pressed) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
241 #ifdef SSD1306OLED
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
242 set_keylog(keycode, record);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
243 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
244 // set_timelog();
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
245 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
246
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
247 switch (keycode) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
248 case QWERTY:
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
249 if (record->event.pressed) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
250 persistent_default_layer_set(1UL<<_QWERTY);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
251 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
252 return false;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
253 break;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
254 case LOWER:
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
255 if (record->event.pressed) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
256 layer_on(_LOWER);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
257 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
258 } else {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
259 layer_off(_LOWER);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
260 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
261 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
262 return false;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
263 break;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
264 case RAISE:
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
265 if (record->event.pressed) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
266 layer_on(_RAISE);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
267 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
268 } else {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
269 layer_off(_RAISE);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
270 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
271 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
272 return false;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
273 break;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
274 case ADJUST:
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
275 if (record->event.pressed) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
276 layer_on(_ADJUST);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
277 } else {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
278 layer_off(_ADJUST);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
279 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
280 return false;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
281 break;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
282 case RGB_MOD:
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
283 #ifdef RGBLIGHT_ENABLE
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
284 if (record->event.pressed) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
285 rgblight_mode(RGB_current_mode);
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
286 rgblight_step();
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
287 RGB_current_mode = rgblight_config.mode;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
288 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
289 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
290 return false;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
291 break;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
292 case RGBRST:
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
293 #ifdef RGBLIGHT_ENABLE
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
294 if (record->event.pressed) {
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
295 eeconfig_update_rgblight_default();
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
296 rgblight_enable();
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
297 RGB_current_mode = rgblight_config.mode;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
298 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
299 #endif
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
300 break;
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
301 case RTAB:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
302 //ctrl-tab
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
303 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
304 SEND_STRING(SS_LCTRL(SS_TAP(X_TAB)));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
305 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
306 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
307 case LTAB:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
308 //ctrl-shift-tab
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
309 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
310 SEND_STRING(SS_LSFT(SS_LCTRL(SS_TAP(X_TAB))));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
311 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
312 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
313 case RSPC:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
314 //ctrl-right
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
315 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
316 SEND_STRING(SS_LCTRL(SS_TAP(X_RIGHT)));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
317 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
318 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
319 case LSPC:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
320 //ctrl-left
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
321 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
322 SEND_STRING(SS_LCTRL(SS_TAP(X_LEFT)));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
323 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
324 break;
2
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
325 case USPC:
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
326 //ctrl-up
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
327 if(record->event.pressed) {
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
328 SEND_STRING(SS_LCTRL(SS_TAP(X_UP)));
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
329 }
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
330 break;
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
331 case DSPC:
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
332 //ctrl-down
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
333 if(record->event.pressed) {
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
334 SEND_STRING(SS_LCTRL(SS_TAP(X_DOWN)));
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
335 }
ef0cbe565d18 - enable bootmagic full
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 1
diff changeset
336 break;
1
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
337 case SSCR:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
338 //shift-cmd-3
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
339 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
340 SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_3))));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
341 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
342 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
343 case SWIN:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
344 //shift-cmd-4
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
345 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
346 SEND_STRING(SS_LSFT(SS_LGUI(SS_TAP(X_4))));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
347 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
348 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
349 case NAPP:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
350 //cmd-tab
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
351 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
352 SEND_STRING(SS_RGUI(SS_TAP(X_TAB)));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
353 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
354 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
355 case NWIN:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
356 //cmd-grave
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
357 if(record->event.pressed) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
358 SEND_STRING(SS_RGUI(SS_TAP(X_GRAVE)));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
359 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
360 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
361
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
362 #if 0
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
363 case _ENTER:
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
364 if (record->event.pressed && get_mods() & MOD_BIT(KC_HYPR)) {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
365 SEND_STRING ("string");
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
366 } else {
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
367 SEND_STRING (SS_TAP(X_ENTER));
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
368 }
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
369 return false;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
370 break;
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
371 #endif
366930ab82c7 - enable features: EXTRAKEY_ENABLE,NKRO_ENABLE
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents: 0
diff changeset
372
0
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
373 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
374 return true;
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
375 }
24e3fb306436 initial import
Yoshiki Yazawa <yaz@honeyplanet.jp>
parents:
diff changeset
376