aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMURAMATSU Atshshi <amura@tomato.sakura.ne.jp>2020-06-16 13:46:12 +0900
committerGitHub <noreply@github.com>2020-06-15 21:46:12 -0700
commit3814dacf27a11e398fe426c4b03b860137b10676 (patch)
tree658bf7bd6dbd171b6e16c19372910ee8b80921c3
parent7576f6162e662c23a174ed8730c93e22a985e7c9 (diff)
downloadqmk_firmware-3814dacf27a11e398fe426c4b03b860137b10676.tar.gz
qmk_firmware-3814dacf27a11e398fe426c4b03b860137b10676.zip
[Keymap] Add froggy keymap with 106/109 (JP) settings for helix keyboard (#8967)
* initial commit for froggy 106 key mode * add mode indicator on OLED * use #pragma once instead of include guard * remove unusable codes * remove audio codes, because helix rev.2 has no audio feature * use set_single_persistent_default_layer * remove eeprom update check
-rw-r--r--keyboards/helix/rev2/keymaps/froggy_106/config.h41
-rw-r--r--keyboards/helix/rev2/keymaps/froggy_106/helixfont.h235
-rw-r--r--keyboards/helix/rev2/keymaps/froggy_106/keymap.c822
-rw-r--r--keyboards/helix/rev2/keymaps/froggy_106/readme.md85
-rw-r--r--keyboards/helix/rev2/keymaps/froggy_106/rules.mk23
5 files changed, 1206 insertions, 0 deletions
diff --git a/keyboards/helix/rev2/keymaps/froggy_106/config.h b/keyboards/helix/rev2/keymaps/froggy_106/config.h
new file mode 100644
index 000000000..36c3f2a79
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/froggy_106/config.h
@@ -0,0 +1,41 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#pragma once
22
23#undef TAPPING_TERM
24#define TAPPING_TERM 200
25#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */
26#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */
27
28// If you need more program area, try select and reduce rgblight modes to use.
29
30// Selection of RGBLIGHT MODE to use.
31#if defined(LED_ANIMATIONS)
32 #define RGBLIGHT_EFFECT_BREATHING
33 #define RGBLIGHT_EFFECT_RAINBOW_MOOD
34 #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
35 #define RGBLIGHT_EFFECT_SNAKE
36 #define RGBLIGHT_EFFECT_KNIGHT
37 #define RGBLIGHT_EFFECT_CHRISTMAS
38 #define RGBLIGHT_EFFECT_STATIC_GRADIENT
39 //#define RGBLIGHT_EFFECT_RGB_TEST
40 //#define RGBLIGHT_EFFECT_ALTERNATING
41#endif
diff --git a/keyboards/helix/rev2/keymaps/froggy_106/helixfont.h b/keyboards/helix/rev2/keymaps/froggy_106/helixfont.h
new file mode 100644
index 000000000..3a79a1937
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/froggy_106/helixfont.h
@@ -0,0 +1,235 @@
1// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
2// See gfxfont.h for newer custom bitmap font info.
3
4#pragma once
5
6#include "progmem.h"
7
8// Standard ASCII 5x7 font
9
10static const unsigned char font[] PROGMEM = {
110x00, 0x00, 0x00, 0x00, 0x00, 0x00,
120x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00,
130x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00,
140x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00,
150x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00,
160x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00,
170x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00,
180x00, 0x18, 0x3C, 0x18, 0x00, 0x00,
190xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00,
200x00, 0x18, 0x24, 0x18, 0x00, 0x00,
210xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00,
220x30, 0x48, 0x3A, 0x06, 0x0E, 0x00,
230x26, 0x29, 0x79, 0x29, 0x26, 0x00,
240x40, 0x7F, 0x05, 0x05, 0x07, 0x00,
250x40, 0x7F, 0x05, 0x25, 0x3F, 0x00,
260x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00,
270x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00,
280x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00,
290x14, 0x22, 0x7F, 0x22, 0x14, 0x00,
300x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00,
310x06, 0x09, 0x7F, 0x01, 0x7F, 0x00,
320x00, 0x66, 0x89, 0x95, 0x6A, 0x00,
330x60, 0x60, 0x60, 0x60, 0x60, 0x00,
340x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00,
350x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
360x10, 0x20, 0x7E, 0x20, 0x10, 0x00,
370x08, 0x08, 0x2A, 0x1C, 0x08, 0x00,
380x08, 0x1C, 0x2A, 0x08, 0x08, 0x00,
390x1E, 0x10, 0x10, 0x10, 0x10, 0x00,
400x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00,
410x30, 0x38, 0x3E, 0x38, 0x30, 0x00,
420x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00,
430x00, 0x00, 0x00, 0x00, 0x00, 0x00,
440x00, 0x00, 0x5F, 0x00, 0x00, 0x00,
450x00, 0x07, 0x00, 0x07, 0x00, 0x00,
460x14, 0x7F, 0x14, 0x7F, 0x14, 0x00,
470x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00,
480x23, 0x13, 0x08, 0x64, 0x62, 0x00,
490x36, 0x49, 0x56, 0x20, 0x50, 0x00,
500x00, 0x08, 0x07, 0x03, 0x00, 0x00,
510x00, 0x1C, 0x22, 0x41, 0x00, 0x00,
520x00, 0x41, 0x22, 0x1C, 0x00, 0x00,
530x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00,
540x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
550x00, 0x80, 0x70, 0x30, 0x00, 0x00,
560x08, 0x08, 0x08, 0x08, 0x08, 0x00,
570x00, 0x00, 0x60, 0x60, 0x00, 0x00,
580x20, 0x10, 0x08, 0x04, 0x02, 0x00,
590x3E, 0x51, 0x49, 0x45, 0x3E, 0x00,
600x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
610x72, 0x49, 0x49, 0x49, 0x46, 0x00,
620x21, 0x41, 0x49, 0x4D, 0x33, 0x00,
630x18, 0x14, 0x12, 0x7F, 0x10, 0x00,
640x27, 0x45, 0x45, 0x45, 0x39, 0x00,
650x3C, 0x4A, 0x49, 0x49, 0x31, 0x00,
660x41, 0x21, 0x11, 0x09, 0x07, 0x00,
670x36, 0x49, 0x49, 0x49, 0x36, 0x00,
680x46, 0x49, 0x49, 0x29, 0x1E, 0x00,
690x00, 0x00, 0x14, 0x00, 0x00, 0x00,
700x00, 0x40, 0x34, 0x00, 0x00, 0x00,
710x00, 0x08, 0x14, 0x22, 0x41, 0x00,
720x14, 0x14, 0x14, 0x14, 0x14, 0x00,
730x00, 0x41, 0x22, 0x14, 0x08, 0x00,
740x02, 0x01, 0x59, 0x09, 0x06, 0x00,
750x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00,
760x7C, 0x12, 0x11, 0x12, 0x7C, 0x00,
770x7F, 0x49, 0x49, 0x49, 0x36, 0x00,
780x3E, 0x41, 0x41, 0x41, 0x22, 0x00,
790x7F, 0x41, 0x41, 0x41, 0x3E, 0x00,
800x7F, 0x49, 0x49, 0x49, 0x41, 0x00,
810x7F, 0x09, 0x09, 0x09, 0x01, 0x00,
820x3E, 0x41, 0x41, 0x51, 0x73, 0x00,
830x7F, 0x08, 0x08, 0x08, 0x7F, 0x00,
840x00, 0x41, 0x7F, 0x41, 0x00, 0x00,
850x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
860x7F, 0x08, 0x14, 0x22, 0x41, 0x00,
870x7F, 0x40, 0x40, 0x40, 0x40, 0x00,
880x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00,
890x7F, 0x04, 0x08, 0x10, 0x7F, 0x00,
900x3E, 0x41, 0x41, 0x41, 0x3E, 0x00,
910x7F, 0x09, 0x09, 0x09, 0x06, 0x00,
920x3E, 0x41, 0x51, 0x21, 0x5E, 0x00,
930x7F, 0x09, 0x19, 0x29, 0x46, 0x00,
940x26, 0x49, 0x49, 0x49, 0x32, 0x00,
950x03, 0x01, 0x7F, 0x01, 0x03, 0x00,
960x3F, 0x40, 0x40, 0x40, 0x3F, 0x00,
970x1F, 0x20, 0x40, 0x20, 0x1F, 0x00,
980x3F, 0x40, 0x38, 0x40, 0x3F, 0x00,
990x63, 0x14, 0x08, 0x14, 0x63, 0x00,
1000x03, 0x04, 0x78, 0x04, 0x03, 0x00,
1010x61, 0x59, 0x49, 0x4D, 0x43, 0x00,
1020x00, 0x7F, 0x41, 0x41, 0x41, 0x00,
1030x02, 0x04, 0x08, 0x10, 0x20, 0x00,
1040x00, 0x41, 0x41, 0x41, 0x7F, 0x00,
1050x04, 0x02, 0x01, 0x02, 0x04, 0x00,
1060x40, 0x40, 0x40, 0x40, 0x40, 0x00,
1070xFC, 0xFE, 0x02, 0x82, 0x82, 0x82,
1080x82, 0x82, 0x82, 0xC2, 0x82, 0x02,
1090x02, 0xFE, 0x00, 0x00, 0xFE, 0xFE,
1100x02, 0x62, 0x62, 0x62, 0x62, 0xE2,
1110x62, 0x62, 0xE2, 0x02, 0x02, 0xFC,
1120x00, 0x00, 0x00, 0xF0, 0xFC, 0xFC,
1130xFC, 0x00, 0xFC, 0xFC, 0xF0, 0x80,
1140x00, 0x00, 0x00, 0x00, 0x00, 0xF0,
1150x30, 0x40, 0x00, 0x00, 0x00, 0x00,
1160x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1170x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1180x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1190x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1200x00, 0x20, 0x00, 0x00, 0x24, 0xA4,
1210xA4, 0xBC, 0xA4, 0x24, 0x24, 0x00,
1220x00, 0x00, 0x24, 0xA4, 0x24, 0x24,
1230x3C, 0x04, 0x04, 0x00, 0x00, 0x00,
1240xB8, 0xA4, 0xA4, 0xA4, 0xBC, 0x00,
1250x00, 0x00, 0x00, 0xFC, 0x00, 0xFC,
1260x00, 0x44, 0x44, 0x44, 0xDC, 0x44,
1270x04, 0x3C, 0x00, 0x00, 0x00, 0x00,
1280xFC, 0xFE, 0xFE, 0x7E, 0x7E, 0x7E,
1290x7E, 0x7E, 0x7E, 0x3E, 0x7E, 0xFE,
1300xFE, 0xFE, 0x00, 0x00, 0xFE, 0xFE,
1310xFE, 0x9E, 0x9E, 0x9E, 0x9E, 0x1E,
1320x9E, 0x9E, 0x1E, 0xFE, 0xFE, 0xFC,
1330x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1340x00, 0x08, 0x36, 0x41, 0x00, 0x00,
1350x00, 0x00, 0x77, 0x00, 0x00, 0x00,
1360x00, 0x41, 0x36, 0x08, 0x00, 0x00,
1370x02, 0x01, 0x02, 0x04, 0x02, 0x00,
1380x3C, 0x26, 0x23, 0x26, 0x3C, 0x00,
1390x7F, 0x7F, 0x40, 0x41, 0x41, 0x41,
1400x41, 0x41, 0x41, 0x41, 0x41, 0x40,
1410x40, 0x7F, 0x00, 0x00, 0x7F, 0x7F,
1420x40, 0x40, 0x40, 0x40, 0x40, 0x41,
1430x40, 0x40, 0x43, 0x40, 0x40, 0x7F,
1440x00, 0x20, 0x3C, 0x3E, 0x3E, 0x3E,
1450x3E, 0x00, 0x3E, 0x3E, 0x3E, 0x3E,
1460x38, 0x00, 0x00, 0xF0, 0xFB, 0xFB,
1470x00, 0x50, 0x60, 0xFF, 0xFC, 0x3C,
1480x1E, 0x0E, 0x0C, 0xFC, 0xF8, 0xE8,
1490xE8, 0xE8, 0x30, 0x00, 0x00, 0x00,
1500x00, 0x00, 0x02, 0x00, 0x00, 0x00,
1510x00, 0x04, 0x04, 0x1B, 0x04, 0x04,
1520x00, 0x00, 0x00, 0x00, 0x57, 0x50,
1530x57, 0x54, 0x57, 0x10, 0x50, 0x00,
1540x00, 0x00, 0x97, 0x94, 0x97, 0x94,
1550xF7, 0x00, 0x00, 0x00, 0x00, 0x00,
1560xE4, 0x14, 0xF4, 0x94, 0xF7, 0x00,
1570x00, 0x00, 0x00, 0xFF, 0x00, 0xFF,
1580x00, 0x38, 0xA4, 0xA4, 0xA5, 0x3C,
1590x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1600x7F, 0x7F, 0x7F, 0x7E, 0x7E, 0x7E,
1610x7E, 0x7E, 0x7E, 0x7E, 0x7E, 0x7F,
1620x7F, 0x7F, 0x00, 0x00, 0x7F, 0x7F,
1630x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7E,
1640x7F, 0x7F, 0x7C, 0x7F, 0x7F, 0x7F,
1650x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1660x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1670x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1680x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1690x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1700x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1710xFE, 0xFE, 0x02, 0x62, 0x62, 0x62,
1720xE2, 0x62, 0x62, 0x62, 0xC2, 0x02,
1730x02, 0xFE, 0x00, 0x00, 0xFE, 0xFE,
1740x02, 0x82, 0xC2, 0xE2, 0xF2, 0x82,
1750x82, 0x82, 0x82, 0x02, 0x02, 0xFE,
1760x00, 0x00, 0x00, 0x3C, 0x66, 0x66,
1770x66, 0x66, 0x66, 0x66, 0x66, 0x66,
1780x00, 0x00, 0x00, 0x07, 0x7F, 0xDF,
1790x00, 0x05, 0x03, 0x7F, 0x1F, 0x1E,
1800x3C, 0x38, 0x18, 0x1F, 0x0F, 0x0D,
1810x0D, 0x0D, 0x06, 0x00, 0x00, 0x00,
1820x00, 0x00, 0x00, 0x20, 0x20, 0x50,
1830x8C, 0x50, 0x20, 0x20, 0x00, 0x00,
1840x00, 0x00, 0x00, 0x00, 0x09, 0x09,
1850x06, 0x09, 0x09, 0x00, 0x00, 0x00,
1860x00, 0x00, 0x1C, 0x12, 0x12, 0x12,
1870x1E, 0x10, 0x10, 0x00, 0x00, 0x00,
1880x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1890x00, 0x00, 0x00, 0xFF, 0x00, 0x73,
1900x84, 0xE7, 0x94, 0x94, 0x94, 0x67,
1910x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1920xFE, 0xFE, 0xFE, 0x9E, 0x9E, 0x9E,
1930x1E, 0x9E, 0x9E, 0x9E, 0x3E, 0xFE,
1940xFE, 0xFE, 0x00, 0x00, 0xFE, 0xFE,
1950xFE, 0x7E, 0x3E, 0x1E, 0x0E, 0x7E,
1960x7E, 0x7E, 0x7E, 0xFE, 0xFE, 0xFE,
1970x00, 0x00, 0x00, 0x3C, 0x66, 0x66,
1980x60, 0x60, 0x60, 0x60, 0x60, 0x60,
1990x00, 0x00, 0x00, 0x07, 0x7F, 0xDF,
2000x00, 0x00, 0xE0, 0xF8, 0xFC, 0xFC,
2010xFC, 0xFC, 0xFC, 0xFC, 0xF0, 0x80,
2020x00, 0x00, 0x00, 0x00, 0x00, 0xF0,
2030x3F, 0x7F, 0x40, 0x46, 0x46, 0x46,
2040x47, 0x46, 0x46, 0x46, 0x43, 0x40,
2050x40, 0x7F, 0x00, 0x00, 0x7F, 0x7F,
2060x40, 0x41, 0x43, 0x47, 0x4F, 0x41,
2070x41, 0x41, 0x41, 0x40, 0x40, 0x3F,
2080x00, 0x00, 0x00, 0x3E, 0x73, 0x60,
2090x70, 0x3E, 0x07, 0x03, 0x67, 0x3E,
2100x00, 0x00, 0x00, 0x00, 0x00, 0x07,
2110x06, 0x01, 0x00, 0x00, 0x00, 0x00,
2120x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2130x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2140x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2150x01, 0x00, 0x00, 0x00, 0x00, 0x00,
2160x00, 0x00, 0x04, 0x00, 0x00, 0x00,
2170x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2180x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2190x00, 0x00, 0x00, 0x00, 0x08, 0x08,
2200x36, 0x08, 0x08, 0x00, 0x00, 0x00,
2210x00, 0x00, 0x00, 0x1F, 0x00, 0x0E,
2220x10, 0x1C, 0x12, 0x12, 0x12, 0x12,
2230x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2240x3F, 0x7F, 0x7F, 0x79, 0x79, 0x79,
2250x78, 0x79, 0x79, 0x79, 0x7C, 0x7F,
2260x7F, 0x7F, 0x00, 0x00, 0x7F, 0x7F,
2270x7F, 0x7E, 0x7C, 0x78, 0x70, 0x7E,
2280x7E, 0x7E, 0x7E, 0x7F, 0x7F, 0x3F,
2290x00, 0x00, 0x00, 0x03, 0x03, 0x03,
2300x03, 0x3F, 0x63, 0x63, 0x63, 0x3F,
2310x00, 0x00, 0x00, 0x00, 0x00, 0x07,
2320x00, 0x00, 0x07, 0x1F, 0x3F, 0x0F,
2330x07, 0x0F, 0x3F, 0x3F, 0x0F, 0x00,
2340x03, 0x06, 0x00, 0xF0, 0xFB, 0xFB,
235};
diff --git a/keyboards/helix/rev2/keymaps/froggy_106/keymap.c b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
new file mode 100644
index 000000000..d32c4fa0c
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/froggy_106/keymap.c
@@ -0,0 +1,822 @@
1#include QMK_KEYBOARD_H
2#include "keymap_jp.h"
3#include <string.h>
4#ifdef SSD1306OLED
5 #include "ssd1306.h"
6#endif
7
8extern uint8_t is_master;
9
10#define DELAY_TIME 75
11static uint16_t key_timer;
12static uint16_t tap_timer;
13static uint16_t delay_registered_code;
14static uint8_t delay_registered_layer;
15static uint8_t delay_mat_row;
16static uint8_t delay_mat_col;
17static bool delay_key_stat;
18static bool delay_key_pressed;
19static bool tapping_key;
20
21// Each layer gets a name for readability, which is then used in the keymap matrix below.
22// The underscores don't mean anything - you can have a layer called STUFF or any other name.
23// Layer names don't all need to be of the same length, obviously, and you can also skip them
24// entirely and just use numbers.
25enum layer_number {
26 _BASE = 0,
27 _BASE_106,
28 _OPT,
29 _OPT_106,
30 _SYM,
31 _SYM_106,
32 _NUM,
33 _NUM_106,
34 _FUNC,
35 _LAYER_NUM,
36};
37bool RGBAnimation = false; //Flag for LED Layer color Refresh.
38
39typedef union {
40 uint32_t raw;
41 struct {
42 bool mac_mode:1;
43 };
44} user_config_t;
45user_config_t user_config;
46
47#define IS_MODE_106() ((default_layer_state & (1UL << _BASE_106)) != 0)
48#define IS_MODE_MAC() (user_config.mac_mode)
49#ifndef MAX
50#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
51#endif
52#ifndef MIN
53#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
54#endif
55
56enum custom_keycodes {
57 QWERTY = SAFE_RANGE,
58 EISU,
59 KANA,
60 RGBRST,
61 RGBOFF,
62 RGB1,
63 RGB2,
64 RGB3,
65 OPT_TAP_SP,
66 DESKTOP,
67 MAC,
68 WIN,
69 L_SYM,
70 L_NUM,
71 TO_106,
72 TO_101,
73};
74
75enum macro_keycodes {
76 KC_SAMPLEMACRO,
77};
78
79//Macros
80#define M_SAMPLE M(KC_SAMPLEMACRO)
81
82#if MATRIX_ROWS == 10 // HELIX_ROWS == 5
83const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
84
85 /* Base
86 * ,-----------------------------------------. ,-----------------------------------------.
87 * | C+z | ; | [ | ( | < | { | | | | | | | |
88 * |------+------+------+------+------+------| |------+------+------+------+------+------|
89 * | KANA | P | K | R | A | F | | | | | | | |
90 * |------+------+------+------+------+------| |------+------+------+------+------+------|
91 * | BS | D | T | H | E | O | | | | | | | |
92 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
93 * | Shift| Y | S | N | I | U |Space | | | | | | | |
94 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
95 * | Ctrl | Alt | Gui | Sym | Num | OPT | Ent | | | | | | | |
96 * `-------------------------------------------------------------------------------------------------'
97 */
98 [_BASE] = LAYOUT( \
99 LCTL(KC_Z), KC_SCLN, KC_LBRC, KC_LPRN, KC_LT, KC_LCBR, _______, _______, _______, _______, _______, _______, \
100 KANA, KC_P, KC_K, KC_R, KC_A, KC_F, _______, _______, _______, _______, _______, _______, \
101 KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, _______, _______, _______, _______, _______, _______, \
102 OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, _______, _______, _______, _______, _______, _______, _______, \
103 OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), L_SYM, L_NUM, OPT_TAP_SP, KC_ENT, _______, _______, _______, _______, _______, _______, _______ \
104 ),
105 [_BASE_106] = LAYOUT( \
106 LCTL(KC_Z), JP_SCLN, JP_LBRC, JP_LPRN, JP_LT, JP_LCBR, _______, _______, _______, _______, _______, _______, \
107 KANA, KC_P, KC_K, KC_R, KC_A, KC_F, _______, _______, _______, _______, _______, _______, \
108 KC_BSPC, KC_D, KC_T, KC_H, KC_E, KC_O, _______, _______, _______, _______, _______, _______, \
109 OSM(MOD_LSFT), KC_Y, KC_S, KC_N, KC_I, KC_U, KC_SPC, _______, _______, _______, _______, _______, _______, _______, \
110 OSM(MOD_LCTL), OSM(MOD_LALT), OSM(MOD_LGUI), L_SYM, L_NUM, OPT_TAP_SP, KC_ENT, _______, _______, _______, _______, _______, _______, _______ \
111 ),
112
113 /* Opt
114 * ,-----------------------------------------. ,-----------------------------------------.
115 * | Esc | : | ] | ) | > | } | | | | | | | |
116 * |------+------+------+------+------+------| |------+------+------+------+------+------|
117 * | EISU| J | M | B | ' | Tab | | | | | | | |
118 * |------+------+------+------+------+------| |------+------+------+------+------+------|
119 * | . | V | C | L | Z | Q | | | | | | | |
120 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
121 * | | X | G | W | - | Del | Esc | | | | | | | |
122 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
123 * | | | | , | DTOP | | | | | | | | | |
124 * `-------------------------------------------------------------------------------------------------'
125 */
126 [_OPT] = LAYOUT( \
127 KC_ESC, KC_COLN,KC_RBRC, KC_RPRN,KC_GT, KC_RCBR, _______, _______, _______, _______, _______, _______, \
128 EISU, KC_J, KC_M, KC_B, KC_QUOT, KC_TAB, _______, _______, _______, _______, _______, _______, \
129 KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, _______, _______, _______, _______, _______, _______, \
130 _______, KC_X, KC_G, KC_W, KC_MINUS, KC_DEL, KC_ESC, _______, _______, _______, _______, _______, _______, _______, \
131 _______, _______,_______, KC_COMM,DESKTOP, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
132 ),
133 [_OPT_106] = LAYOUT( \
134 KC_ESC, JP_COLN,JP_RBRC, JP_RPRN,JP_GT, JP_RCBR, _______, _______, _______, _______, _______, _______, \
135 EISU, KC_J, KC_M, KC_B, JP_QUOT, KC_TAB, _______, _______, _______, _______, _______, _______, \
136 KC_DOT, KC_V, KC_C, KC_L, KC_Z, KC_Q, _______, _______, _______, _______, _______, _______, \
137 _______, KC_X, KC_G, KC_W, JP_MINS, KC_DEL, KC_ESC, _______, _______, _______, _______, _______, _______, _______, \
138 _______, _______,_______, KC_COMM,DESKTOP, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
139 ),
140
141 /* Sym
142 * ,-----------------------------------------. ,-----------------------------------------.
143 * | Ins | GRV | | PU | PD | ^ | | | | | | | |
144 * |------+------+------+------+------+------| |------+------+------+------+------+------|
145 * | | \ | # | = | ? | % | | | | | | | |
146 * |------+------+------+------+------+------| |------+------+------+------+------+------|
147 * | | $ | upA | @ | ! | | | | | | | | | |
148 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
149 * | CL | <- | dwA | -> | _ | & | | | | | | | | |
150 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
151 * | | | PS | | ~ | | | | | | | | | |
152 * `-------------------------------------------------------------------------------------------------'
153 */
154 [_SYM] = LAYOUT( \
155 KC_INS, KC_GRV, _______, KC_PGUP, KC_PGDN, KC_CIRC, _______, _______, _______, _______, _______, _______, \
156 _______, KC_BSLS, KC_HASH, KC_EQL, KC_QUES, KC_PERC, _______, _______, _______, _______, _______, _______, \
157 _______, KC_DLR, KC_UP, KC_AT, KC_EXLM, KC_PIPE, _______, _______, _______, _______, _______, _______, \
158 KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_UNDS, KC_AMPR, _______, _______, _______, _______, _______, _______, _______, _______, \
159 _______, _______, KC_PSCR, _______, KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
160 ),
161 [_SYM_106] = LAYOUT( \
162 KC_INS, JP_GRV, _______, KC_PGUP, KC_PGDN, JP_CIRC, _______, _______, _______, _______, _______, _______, \
163 _______, JP_BSLS, JP_HASH, JP_EQL, JP_QUES, JP_PERC, _______, _______, _______, _______, _______, _______, \
164 _______, JP_DLR, KC_UP, JP_AT, JP_EXLM, JP_PIPE, _______, _______, _______, _______, _______, _______, \
165 KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT,JP_UNDS, JP_AMPR, _______, _______, _______, _______, _______, _______, _______, _______, \
166 _______, _______, KC_PSCR, _______, JP_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
167 ),
168
169 /* Raise
170 * ,-----------------------------------------. ,-----------------------------------------.
171 * | | | Func | home | End | | | | | | | | |
172 * |------+------+------+------+------+------| |------+------+------+------+------+------|
173 * | | * | 7 | 8 | 9 | - | | | | | | | |
174 * |------+------+------+------+------+------| |------+------+------+------+------+------|
175 * | . | / | 4 | 5 | 6 | + | | | | | | | |
176 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
177 * | LN | 0 | 1 | 2 | 3 |C+S+F1| | | | | | | | |
178 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
179 * | | | . | , | | | | | | | | | | |
180 * `-------------------------------------------------------------------------------------------------'
181 */
182 [_NUM] = LAYOUT( \
183 _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, _______, _______, _______, _______, _______, _______, \
184 _______, KC_ASTR, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, _______, _______, _______, _______, \
185 KC_DOT, KC_SLSH, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, _______, _______, _______, _______, _______, \
186 KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, _______, _______, _______, _______, _______, _______, _______, \
187 _______, _______, KC_PDOT, KC_COMM, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
188 ),
189 [_NUM_106] = LAYOUT( \
190 _______, _______, OSL(_FUNC), KC_HOME, KC_END, _______, _______, _______, _______, _______, _______, _______, \
191 _______, JP_ASTR, KC_P7, KC_P8, KC_P9, JP_MINS, _______, _______, _______, _______, _______, _______, \
192 KC_DOT, JP_SLSH, KC_P4, KC_P5, KC_P6, JP_PLUS, _______, _______, _______, _______, _______, _______, \
193 KC_NLCK, KC_P0, KC_P1, KC_P2, KC_P3, LCTL(S(KC_F1)), _______, _______, _______, _______, _______, _______, _______, _______, \
194 _______, _______, KC_PDOT, JP_COMM, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
195 ),
196
197 /* Func
198 * ,-----------------------------------------. ,-----------------------------------------.
199 * |RGBRST| Hue |To101 | RST | Mac | Win | | | | | | | |
200 * |------+------+------+------+------+------| |------+------+------+------+------+------|
201 * | RGB1 | VAL+ | F7 | F8 | F9 |To106 | | | | | | | |
202 * |------+------+------+------+------+------| |------+------+------+------+------+------|
203 * | RGB2 | VAL- | F4 | F5 | F6 | F12 | | | | | | | |
204 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
205 * | RGB3 | F10 | F1 | F2 | F3 | F11 | | | | | | | | |
206 * |------+------+------+------+------+------+------+------+------+------+------+------+------+------|
207 * |RGBOFF| | | | | | | | | | | | | |
208 * `-------------------------------------------------------------------------------------------------'
209 */
210 [_FUNC] = LAYOUT( \
211 RGBRST,RGB_HUI, TO_101, RESET, MAC, WIN, _______, _______, _______, _______, _______, _______, \
212 RGB1, RGB_VAI, KC_F7, KC_F8, KC_F9, TO_106, _______, _______, _______, _______, _______, _______, \
213 RGB2, RGB_VAD, KC_F4, KC_F5, KC_F6, KC_F12, _______, _______, _______, _______, _______, _______, \
214 RGB3, KC_F10, KC_F1, KC_F2, KC_F3, KC_F11, _______, _______, _______, _______, _______, _______, _______, _______, \
215 RGBOFF,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
216 )
217};
218#else
219#error "undefined keymaps"
220#endif
221
222void set_mac_mode(bool enable) {
223 if(enable){
224 user_config.mac_mode = true;
225 keymap_config.swap_lalt_lgui = false;
226 keymap_config.swap_ralt_rgui = false;
227 }else{
228 user_config.mac_mode = false;
229 keymap_config.swap_lalt_lgui = true;
230 keymap_config.swap_ralt_rgui = true;
231 }
232 eeconfig_update_user(user_config.raw);
233}
234
235void eeconfig_init_user(void) {
236 user_config.raw = 0;
237 eeconfig_update_user(user_config.raw);
238}
239
240void keyboard_post_init_user(void) {
241 user_config.raw = eeconfig_read_user();
242 set_mac_mode(user_config.mac_mode);
243}
244
245bool find_mairix(uint16_t keycode, uint8_t *row, uint8_t *col){
246 int base_keymap = IS_MODE_106() ? _BASE_106 : _BASE;
247 for(uint8_t i=0; i<MATRIX_ROWS; i++){
248 for(uint8_t j=0; j<MATRIX_COLS; j++){
249 if( pgm_read_word(&(keymaps[base_keymap][i][j]))==keycode){
250 *row = i;
251 *col = j;
252 return true;
253 }
254 }
255 }
256 return false;
257}
258
259void unregister_delay_code(void){
260 if(delay_registered_code){
261 unregister_code(delay_registered_code);
262 if (delay_registered_code & QK_LSFT){
263 unregister_code(KC_LSFT);
264 }
265 if (delay_registered_code & QK_LCTL){
266 unregister_code(KC_LCTL);
267 }
268 if (delay_registered_code & QK_LALT){
269 unregister_code(KC_LALT);
270 }
271 if (delay_registered_code & QK_LGUI){
272 unregister_code(KC_LGUI);
273 }
274 delay_registered_code=0;
275 delay_registered_layer=0;
276 }
277}
278
279void register_delay_code(uint8_t layer){
280 if(delay_key_stat){
281 unregister_delay_code();
282
283 uint16_t code = pgm_read_word(&(keymaps[layer][delay_mat_row][delay_mat_col]));
284 if (code & QK_LSFT){
285 register_code(KC_LSFT);
286 }
287 if (code & QK_LCTL){
288 register_code(KC_LCTL);
289 }
290 if (code & QK_LALT){
291 register_code(KC_LALT);
292 }
293 if (code & QK_LGUI){
294 register_code(KC_LGUI);
295 }
296 register_code(code);
297 delay_registered_code = code;
298 delay_registered_layer = layer;
299 delay_key_stat = false;
300 tapping_key = true;
301 }
302}
303
304#ifdef RGBLIGHT_ENABLE
305struct keybuf {
306 char col, row;
307 char frame;
308};
309struct keybuf keybufs[256];
310unsigned char keybuf_begin, keybuf_end;
311
312int col, row;
313#endif
314
315bool process_record_user(uint16_t keycode, keyrecord_t *record) {
316
317 #ifdef RGBLIGHT_ENABLE
318 col = record->event.key.col;
319 row = record->event.key.row;
320 if (record->event.pressed && ((row < 5 && is_master) || (row >= 5 && !is_master))) {
321 int end = keybuf_end;
322 keybufs[end].col = col;
323 keybufs[end].row = row % 5;
324 keybufs[end].frame = 0;
325 keybuf_end ++;
326 }
327 #endif
328
329 if(tap_timer&&keycode!=OPT_TAP_SP){
330 tapping_key = true;
331 }
332
333 if(keycode==delay_registered_code){
334 if (!record->event.pressed){
335 unregister_delay_code();
336 }
337 }
338
339 switch (keycode) {
340 case KC_SCLN:
341 case KC_LBRC:
342 case KC_LPRN:
343 case KC_LT:
344 case KC_LCBR:
345 case KC_P:
346 case KC_K:
347 case KC_R:
348 case KC_A:
349 case KC_F:
350 case KC_BSPC:
351 case KC_D:
352 case KC_T:
353 case KC_H:
354 case KC_E:
355 case KC_O:
356 case KC_Y:
357 case KC_S:
358 case KC_N:
359 case KC_I:
360 case KC_U:
361 case LCTL(KC_Z):
362 case KC_SPC:
363 //case JP_SCLN: // == KC_SCLN
364 case JP_LBRC:
365 case JP_LPRN:
366 //case JP_LT: // == KC_LT
367 case JP_LCBR:
368 if (IS_MODE_106()) {
369 if (keycode == KC_LBRC || keycode == KC_LPRN || keycode == KC_LCBR)
370 break;
371 }else{
372 if (keycode == JP_LBRC || keycode == JP_LPRN || keycode == JP_LCBR)
373 break;
374 }
375 if (record->event.pressed) {
376 if (IS_MODE_106())
377 register_delay_code(_BASE_106);
378 else
379 register_delay_code(_BASE);
380 if(find_mairix(keycode, &delay_mat_row, &delay_mat_col)){
381 key_timer = timer_read();
382 delay_key_stat = true;
383 delay_key_pressed = true;
384 }
385 }else{
386 delay_key_pressed = false;
387 }
388 return false;
389 break;
390 case L_SYM:
391 if (record->event.pressed) {
392 if (IS_MODE_106()) {
393 register_delay_code(_SYM_106);
394 layer_on(_SYM_106);
395 }else{
396 register_delay_code(_SYM);
397 layer_on(_SYM);
398 }
399 }else{
400 layer_off(_SYM);
401 layer_off(_SYM_106);
402 if(delay_registered_layer == _SYM || delay_registered_layer == _SYM_106) {
403 unregister_delay_code();
404 }
405 }
406 return false;
407 break;
408 case L_NUM:
409 if (record->event.pressed) {
410 if (IS_MODE_106()) {
411 register_delay_code(_NUM_106);
412 layer_on(_NUM_106);
413 }else{
414 register_delay_code(_NUM);
415 layer_on(_NUM);
416 }
417 }else{
418 layer_off(_NUM);
419 layer_off(_NUM_106);
420 if(delay_registered_layer == _NUM || delay_registered_layer == _NUM_106) {
421 unregister_delay_code();
422 }
423 }
424 return false;
425 break;
426 case OPT_TAP_SP:
427 if (record->event.pressed) {
428 tapping_key = false;
429 if (IS_MODE_106()) {
430 register_delay_code(_OPT_106);
431 layer_on(_OPT_106);
432 }else{
433 register_delay_code(_OPT);
434 layer_on(_OPT);
435 }
436 tap_timer = timer_read();
437 }else{
438 layer_off(_OPT);
439 layer_off(_OPT_106);
440 if(tapping_key==false && timer_elapsed(tap_timer) < TAPPING_TERM){
441 SEND_STRING(" ");
442 }else if(delay_registered_layer == _OPT || delay_registered_layer == _OPT_106) {
443 unregister_delay_code();
444 }
445 tap_timer = 0;
446 }
447 return false;
448 break;
449 case EISU:
450 if (record->event.pressed) {
451 if(IS_MODE_MAC()){
452 register_code(KC_LANG2);
453 }else{
454 SEND_STRING(SS_LALT("`"));
455 }
456 } else {
457 unregister_code(KC_LANG2);
458 }
459 return false;
460 break;
461 case KANA:
462 if (record->event.pressed) {
463 if(IS_MODE_MAC()){
464 register_code(KC_LANG1);
465 }else{
466 SEND_STRING(SS_LALT("`"));
467 }
468 } else {
469 unregister_code(KC_LANG1);
470 }
471 return false;
472 break;
473 case DESKTOP:
474 if (record->event.pressed) {
475 if(IS_MODE_MAC()){
476 register_code(KC_F11);
477 }else{
478 SEND_STRING(SS_LGUI("d"));
479 }
480 } else {
481 unregister_code(KC_F11);
482 }
483 return false;
484 break;
485 case RGBRST:
486 #ifdef RGBLIGHT_ENABLE
487 if (record->event.pressed) {
488 eeconfig_update_rgblight_default();
489 rgblight_enable();
490 RGBAnimation = false;
491 }
492 #endif
493 break;
494 case RGBOFF:
495 #ifdef RGBLIGHT_ENABLE
496 if (record->event.pressed) {
497 rgblight_disable();
498 }
499 #endif
500 break;
501 case RGB1:
502 #ifdef RGBLIGHT_ENABLE
503 if (record->event.pressed) {
504 RGBAnimation = true;
505 rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD);
506 }
507 #endif
508 break;
509 case RGB2:
510 #ifdef RGBLIGHT_ENABLE
511 if (record->event.pressed) {
512 RGBAnimation = true;
513 rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 1);
514 }
515 #endif
516 break;
517 case RGB3:
518 #ifdef RGBLIGHT_ENABLE
519 if (record->event.pressed) {
520 RGBAnimation = true;
521 rgblight_mode(RGBLIGHT_MODE_KNIGHT);
522 }
523 #endif
524 break;
525 case MAC:
526 if (record->event.pressed) {
527 set_mac_mode(true);
528 }
529 break;
530 case WIN:
531 if (record->event.pressed) {
532 set_mac_mode(false);
533 }
534 break;
535 case TO_101:
536 if (record->event.pressed) {
537 if (IS_MODE_106()) {
538 set_single_persistent_default_layer(_BASE);
539 }
540 }
541 break;
542 case TO_106:
543 if (record->event.pressed) {
544 if (!IS_MODE_106()) {
545 set_single_persistent_default_layer(_BASE_106);
546 }
547 }
548 break;
549 }
550 return true;
551}
552
553
554//keyboard start-up code. Runs once when the firmware starts up.
555void matrix_init_user(void) {
556 //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
557 #ifdef SSD1306OLED
558 iota_gfx_init(!has_usb()); // turns on the display
559 #endif
560}
561
562// LED Effect
563#ifdef RGBLIGHT_ENABLE
564unsigned char rgb[7][5][3];
565void led_ripple_effect(char r, char g, char b) {
566 static int scan_count = -10;
567 static int keys[] = { 6, 6, 6, 7, 7 };
568 static int keys_sum[] = { 0, 6, 12, 18, 25 };
569
570 if (scan_count == -1) {
571 rgblight_enable_noeeprom();
572 rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT);
573 } else if (scan_count >= 0 && scan_count < 5) {
574 for (unsigned char c=keybuf_begin; c!=keybuf_end; c++) {
575 int i = c;
576 // FIXME:
577
578 int y = scan_count;
579 int dist_y = abs(y - keybufs[i].row);
580 for (int x=0; x<keys[y]; x++) {
581 int dist = abs(x - keybufs[i].col) + dist_y;
582 if (dist <= keybufs[i].frame) {
583 int elevation = MAX(0, (8 + dist - keybufs[i].frame)) << 2;
584 if (elevation) {
585 if ((rgb[x][y][0] != 255) && r) { rgb[x][y][0] = MIN(255, elevation + rgb[x][y][0]); }
586 if ((rgb[x][y][1] != 255) && g) { rgb[x][y][1] = MIN(255, elevation + rgb[x][y][1]); }
587 if ((rgb[x][y][2] != 255) && b) { rgb[x][y][2] = MIN(255, elevation + rgb[x][y][2]); }
588 }
589 }
590 }
591 }
592 } else if (scan_count == 5) {
593 for (unsigned char c=keybuf_begin; c!=keybuf_end; c++) {
594 int i = c;
595 if (keybufs[i].frame < 18) {
596 keybufs[i].frame ++;
597 } else {
598 keybuf_begin ++;
599 }
600 }
601 } else if (scan_count >= 6 && scan_count <= 10) {
602 int y = scan_count - 6;
603 for (int x=0; x<keys[y]; x++) {
604 int at = keys_sum[y] + ((y & 1) ? x : (keys[y] - x - 1));
605 led[at].r = rgb[x][y][0];
606 led[at].g = rgb[x][y][1];
607 led[at].b = rgb[x][y][2];
608 }
609 rgblight_set();
610 } else if (scan_count == 11) {
611 memset(rgb, 0, sizeof(rgb));
612 }
613 scan_count++;
614 if (scan_count >= 12) { scan_count = 0; }
615}
616#endif
617
618layer_state_t layer_state_old;
619
620//runs every scan cycle (a lot)
621void matrix_scan_user(void) {
622 #ifdef SSD1306OLED
623 iota_gfx_task(); // this is what updates the display continuously
624 #endif
625
626 if(delay_key_stat && (timer_elapsed(key_timer) > DELAY_TIME)){
627 if (IS_MODE_106())
628 register_delay_code(_BASE_106);
629 else
630 register_delay_code(_BASE);
631 if(!delay_key_pressed){
632 unregister_delay_code();
633 }
634 }
635
636 if(layer_state_old != layer_state){
637 for (int8_t i = _LAYER_NUM-1; i > _BASE_106; i--) {
638 if(IS_LAYER_ON(i)){
639 register_delay_code(i);
640 break;
641 }
642 }
643 layer_state_old = layer_state;
644 }
645
646 #ifdef RGBLIGHT_ENABLE
647 if(!RGBAnimation){
648 if(IS_LAYER_ON(_FUNC)){
649 #ifdef RGBLED_BACK
650 led_ripple_effect(127,23,0);
651 #else
652 rgblight_setrgb(127,23,0);
653 #endif
654 }else if(IS_LAYER_ON(_NUM)||IS_LAYER_ON(_NUM_106)){
655 #ifdef RGBLED_BACK
656 led_ripple_effect(127,0,61);
657 #else
658 rgblight_setrgb(127,0,61);
659 #endif
660 }else if(IS_LAYER_ON(_SYM)||IS_LAYER_ON(_SYM_106)){
661 #ifdef RGBLED_BACK
662 led_ripple_effect(0,127,0);
663 #else
664 rgblight_setrgb(0,127,0);
665 #endif
666 }else if(IS_LAYER_ON(_OPT)||IS_LAYER_ON(_OPT_106)){
667 #ifdef RGBLED_BACK
668 led_ripple_effect(127,0,100);
669 #else
670 rgblight_setrgb(127,0,100);
671 #endif
672 } else {
673 #ifdef RGBLED_BACK
674 led_ripple_effect(0,112,127);
675 #else
676 rgblight_setrgb(0,112,127);
677 #endif
678 }
679 }
680 #endif
681}
682
683//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
684#ifdef SSD1306OLED
685
686void matrix_update(struct CharacterMatrix *dest,
687 const struct CharacterMatrix *source) {
688 if (memcmp(dest->display, source->display, sizeof(dest->display))) {
689 memcpy(dest->display, source->display, sizeof(dest->display));
690 dest->dirty = true;
691 }
692}
693
694// Render to OLED
695void render_status(struct CharacterMatrix *matrix) {
696
697 // froggy logo
698 static char logo[4][17]=
699 {
700 {0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0},
701 {0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0},
702 {0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,0},
703 {0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0},
704 };
705
706 static char modectl[4][2][4]=
707 {
708 {
709 {0x65,0x66,0x67,0}, //WIN
710 {0x85,0x86,0x87,0}, //WIN
711 },
712 {
713 {0xa5,0xa6,0xa7,0}, //US(101)
714 {0xc5,0xc6,0xc7,0}, //US(101)
715 },
716 {
717 {0xbd,0xbe,0xbf,0}, //MAC
718 {0xdd,0xde,0xdf,0}, //MAC
719 },
720 {
721 {0xba,0xbb,0xbc,0}, //JP(106)
722 {0xda,0xdb,0xdc,0}, //JP(106)
723 },
724 };
725
726 static char indctr[8][2][4]=
727 {
728 // white icon
729 {
730 {0x60,0x61,0x62,0}, //NUM
731 {0x63,0x64,0} //FUNC
732 },
733 {
734 {0x80,0x81,0x82,0}, //NUM
735 {0x83,0x84,0} //FUNC
736 },
737 {
738 {0xa0,0xa1,0xa2,0}, //CAPS
739 {0xa3,0xa4,0} //SCLK
740 },
741 {
742 {0xc0,0xc1,0xc2,0}, //CAPS
743 {0xc3,0xc4,0} //SCLK
744 },
745 // Black icon
746 {
747 {0x75,0x76,0x77,0}, //NUM
748 {0x78,0x79,0} //FUNC
749 },
750 {
751 {0x95,0x96,0x97,0}, //NUM
752 {0x98,0x99,0} //FUNC
753 },
754 {
755 {0xb5,0xb6,0xb7,0}, //CAPS
756 {0xb8,0xb9,0} //SCLK
757 },
758 {
759 {0xd5,0xd6,0xd7,0}, //CAPS
760 {0xd8,0xd9,0} //SCLK
761 },
762 };
763
764 int rown = 0;
765 int rowf = 0;
766 int rowa = 0;
767 int rows = 0;
768 int rowm = 0;
769 int rowj = 1;
770
771 //Set Indicator icon
772 if (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) { rown = 4; }
773 if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) { rowa = 4; }
774 if (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) { rows = 4; }
775 if (IS_LAYER_ON(_FUNC)) { rowf = 4; }
776
777 //Set Mode icon
778 if (IS_MODE_MAC()) { rowm = 2; }
779 if (IS_MODE_106()) { rowj = 3; }
780
781 matrix_write(matrix, indctr[rown] [0]);
782 matrix_write(matrix, indctr[rowf] [1]);
783 matrix_write(matrix, modectl[rowm] [0]);
784 matrix_write(matrix, logo[0]);
785 matrix_write(matrix, indctr[rown+1][0]);
786 matrix_write(matrix, indctr[rowf+1][1]);
787 matrix_write(matrix, modectl[rowm] [1]);
788 matrix_write(matrix, logo[1]);
789 matrix_write(matrix, indctr[rowa+2][0]);
790 matrix_write(matrix, indctr[rows+2][1]);
791 matrix_write(matrix, modectl[rowj] [0]);
792 matrix_write(matrix, logo[2]);
793 matrix_write(matrix, indctr[rowa+3][0]);
794 matrix_write(matrix, indctr[rows+3][1]);
795 matrix_write(matrix, modectl[rowj] [1]);
796 matrix_write(matrix, logo[3]);
797
798}
799
800void iota_gfx_task_user(void) {
801 struct CharacterMatrix matrix;
802
803#if DEBUG_TO_SCREEN
804 if (debug_enable) {
805 return;
806 }
807#endif
808
809 matrix_clear(&matrix);
810 if(is_master){
811 render_status(&matrix);
812 }
813 matrix_update(&display, &matrix);
814}
815
816#endif
817
818// Local Variables:
819// mode: c++
820// truncate-lines: t
821// indent-tabs-mode: nil
822// End:
diff --git a/keyboards/helix/rev2/keymaps/froggy_106/readme.md b/keyboards/helix/rev2/keymaps/froggy_106/readme.md
new file mode 100644
index 000000000..911fb4043
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/froggy_106/readme.md
@@ -0,0 +1,85 @@
1Froggy -one hand Helix- with 106-key mode
2======
3
4![Imgur](https://i.imgur.com/S1Dw3XW.jpg)
5
6## Features
7It is a one-handed keyboard with reference to Frogpad. Layout Designed by タクマ ([@humid](https://twitter.com/humid)).
8
9This keymap has 106-key mode, This is usable when keyboard setting of OS is OADG 106/109 keyboard.
10
11## Layout
12### Base
13```
14,-----------------------------------------.
15| C+z | ; | [ | ( | < | { |
16|------+------+------+------+------+------|
17| KANA | P | K | R | A | F |
18|------+------+------+------+------+------|
19| BS | D | T | H | E | O |
20|------+------+------+------+------+------+------.
21| Shift| Y | S | N | I | U | Space|
22|------+------+------+------+------+------+------|
23| Ctrl | Alt | win | Sym | Num | OPT | Ent |
24`------------------------------------------------'
25```
26
27### Opt
28```
29,-----------------------------------------.
30| Esc | : | ] | ) | > | } |
31|------+------+------+------+------+------|
32| EISU | J | M | B | ' | Tab |
33|------+------+------+------+------+------|
34| . | V | C | L | Z | Q |
35|------+------+------+------+------+------+------.
36| | X | G | W | - | Del | Esc |
37|------+------+------+------+------+------+------|
38| | | | , | DTOP | | |
39`------------------------------------------------'
40```
41
42### Num
43```
44,-----------------------------------------.
45| | | Func | home | End | |
46|------+------+------+------+------+------|
47| | * | 7 | 8 | 9 | - |
48|------+------+------+------+------+------|
49| . | / | 4 | 5 | 6 | + |
50|------+------+------+------+------+------+------.
51| LN | 0 | 1 | 2 | 3 |C+S+F1| |
52|------+------+------+------+------+------+------|
53| | | | , | | | |
54`------------------------------------------------'
55```
56
57### Sym
58```
59,-----------------------------------------.
60| Ins | GRV | | PU | PD | ^ |
61|------+------+------+------+------+------|
62| | \ | # | = | ? | % |
63|------+------+------+------+------+------|
64| | $ | upA | @ | ! | | |
65|------+------+------+------+------+------+------.
66| CL | <- | dwA | -> | _ | & | |
67|------+------+------+------+------+------+------|
68| | | PS | | ~ | | |
69 `-----------------------------------------------'
70```
71
72### Func
73```
74,-----------------------------------------.
75|RGBRST| Hue | to101| RST | Mac | Win |
76|------+------+------+------+------+------|
77| RGB1 | VAL+ | F7 | F8 | F9 | to106|
78|------+------+------+------+------+------|
79| RGB2 | VAL- | F4 | F5 | F6 | F12 |
80|------+------+------+------+------+------+------.
81| RGB3 | F10 | F1 | F2 | F3 | F11 | |
82|------+------+------+------+------+------+------|
83|RGBOFF| | | | | | |
84`------------------------------------------------'
85```
diff --git a/keyboards/helix/rev2/keymaps/froggy_106/rules.mk b/keyboards/helix/rev2/keymaps/froggy_106/rules.mk
new file mode 100644
index 000000000..bea059ca1
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/froggy_106/rules.mk
@@ -0,0 +1,23 @@
1# QMK Standard Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5# See TOP/keyboards/helix/rules.mk for a list of options that can be set.
6# See TOP/docs/config_options.md for more information.
7#
8LINK_TIME_OPTIMIZATION_ENABLE = no # if firmware size over limit, try this option
9
10# Helix Spacific Build Options
11# you can uncomment and edit follows 7 Variables
12# jp: 以下の7つの変数を必要に応じて編集し、コメントアウトをはずします。
13HELIX_ROWS = 5 # Helix Rows is 4 or 5
14OLED_ENABLE = yes # OLED_ENABLE
15LOCAL_GLCDFONT = yes # use each keymaps "helixfont.h" insted of "common/glcdfont.c"
16LED_BACK_ENABLE = yes # LED backlight (Enable WS2812 RGB underlight.)
17LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.)
18LED_ANIMATIONS = yes # LED animations
19# IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone)
20
21# convert Helix-specific options (that represent combinations of standard options)
22# into QMK standard options.
23include $(strip $(KEYBOARD_LOCAL_FEATURES_MK))