aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/le_chiffre/config.h39
-rw-r--r--keyboards/le_chiffre/keymaps/default/config.h21
-rw-r--r--keyboards/le_chiffre/keymaps/default/keymap.c228
-rw-r--r--keyboards/le_chiffre/keymaps/default/rules.mk1
-rw-r--r--keyboards/le_chiffre/keymaps/via/keymap.c161
-rw-r--r--keyboards/le_chiffre/keymaps/via/rules.mk1
-rw-r--r--keyboards/le_chiffre/le_chiffre.c30
-rw-r--r--keyboards/le_chiffre/le_chiffre.h15
-rw-r--r--keyboards/le_chiffre/rules.mk7
9 files changed, 414 insertions, 89 deletions
diff --git a/keyboards/le_chiffre/config.h b/keyboards/le_chiffre/config.h
index 1ab07a645..e14b4665f 100644
--- a/keyboards/le_chiffre/config.h
+++ b/keyboards/le_chiffre/config.h
@@ -1,9 +1,24 @@
1/* Copyright 2020 tominabox1
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 */
1#pragma once 16#pragma once
2 17
3#include "config_common.h" 18#include "config_common.h"
4 19
5/* USB Device descriptor parameter */ 20/* USB Device descriptor parameter */
6#define VENDOR_ID 0xFEED 21#define VENDOR_ID 0x7431
7#define PRODUCT_ID 0xD645 22#define PRODUCT_ID 0xD645
8#define DEVICE_VER 0x0001 23#define DEVICE_VER 0x0001
9#define MANUFACTURER tominabox1 24#define MANUFACTURER tominabox1
@@ -42,5 +57,23 @@
42#define ENCODERS_PAD_A { D5 } 57#define ENCODERS_PAD_A { D5 }
43#define ENCODERS_PAD_B { D3 } 58#define ENCODERS_PAD_B { D3 }
44 59
45/* #define RGB_DI_PIN F0 60/*
46 #define RGBLED_NUM 1 */ 61 * WS2812 Underglow Matrix options
62 */
63#define RGB_DI_PIN F0
64#define RGBLED_NUM 11
65
66#define DRIVER_LED_TOTAL RGBLED_NUM
67
68#define RGBLIGHT_ANIMATIONS
69
70#ifdef RGB_MATRIX_ENABLE
71#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
72#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
73#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
74#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
75#define RGB_MATRIX_HUE_STEP 8
76#define RGB_MATRIX_SAT_STEP 8
77#define RGB_MATRIX_VAL_STEP 8
78#define RGB_MATRIX_SPD_STEP 10
79#endif
diff --git a/keyboards/le_chiffre/keymaps/default/config.h b/keyboards/le_chiffre/keymaps/default/config.h
new file mode 100644
index 000000000..ce604301a
--- /dev/null
+++ b/keyboards/le_chiffre/keymaps/default/config.h
@@ -0,0 +1,21 @@
1/* Copyright 2020 tominabox1
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#pragma once
17
18#define IGNORE_MOD_TAP_INTERRUPT //helps with homerow mods
19
20#define COMBO_COUNT 5
21#define COMBO_TERM 30
diff --git a/keyboards/le_chiffre/keymaps/default/keymap.c b/keyboards/le_chiffre/keymaps/default/keymap.c
index d5ca6969d..9ff8fc299 100644
--- a/keyboards/le_chiffre/keymaps/default/keymap.c
+++ b/keyboards/le_chiffre/keymaps/default/keymap.c
@@ -1,3 +1,18 @@
1/* Copyright 2020 tominabox1
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 */
1#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
2 17
3enum layers{ 18enum layers{
@@ -6,6 +21,14 @@ enum layers{
6 _NAV 21 _NAV
7}; 22};
8 23
24enum combo_events {
25 COMBO_BSPC,
26 COMBO_NUMBAK,
27 COMBO_TAB,
28 COMBO_ESC,
29 COMBO_DEL,
30};
31
9#define KC_NUM_SPC LT(_NUM_SYM, KC_SPC) 32#define KC_NUM_SPC LT(_NUM_SYM, KC_SPC)
10#define KC_GA LGUI_T(KC_A) 33#define KC_GA LGUI_T(KC_A)
11#define KC_AS LALT_T(KC_S) 34#define KC_AS LALT_T(KC_S)
@@ -42,101 +65,138 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42void encoder_update_user(uint8_t index, bool clockwise) { 65void encoder_update_user(uint8_t index, bool clockwise) {
43 if (index == 0) { 66 if (index == 0) {
44 if (clockwise) { 67 if (clockwise) {
45 tap_code(KC_MNXT); 68 tap_code(KC_VOLU);
46 } else { 69 } else {
47 tap_code(KC_MPRV); 70 tap_code(KC_VOLD);
48 } 71 }
49 } 72 }
50} 73}
51 74
52#ifdef OLED_DRIVER_ENABLE 75#ifdef COMBO_ENABLE
76const uint16_t PROGMEM combo_bspc[] = {KC_O, KC_P, COMBO_END};
77const uint16_t PROGMEM combo_numbak[] = {KC_0, KC_9, COMBO_END};
78const uint16_t PROGMEM combo_tab[] = {KC_Q, KC_W, COMBO_END};
79const uint16_t PROGMEM combo_esc[] = {KC_E, KC_W, COMBO_END};
80const uint16_t PROGMEM combo_del[] = {KC_MINS, KC_EQL, COMBO_END};
81
82combo_t key_combos[COMBO_COUNT] = {
83 [COMBO_BSPC] = COMBO(combo_bspc,KC_BSPC),
84 [COMBO_NUMBAK] = COMBO(combo_numbak,KC_BSPC),
85 [COMBO_TAB] = COMBO(combo_tab,KC_TAB),
86 [COMBO_ESC] = COMBO(combo_esc,KC_ESC),
87 [COMBO_DEL] = COMBO(combo_del,KC_DEL),
88
89};
90#endif
91
92#ifdef OLED_DRIVER_ENABLE //Special thanks to Sickbabies for this great OLED widget!
53oled_rotation_t oled_init_user(oled_rotation_t rotation) { 93oled_rotation_t oled_init_user(oled_rotation_t rotation) {
54 return OLED_ROTATION_90; // flips the display 180 degrees if offhand 94 return OLED_ROTATION_90; // rotates for proper orientation
55} 95}
56 96
57void oled_task_user(void) { 97void render_lechiffre_logo(void) {
58 static const char PROGMEM base_logo[] = { 98 static const char PROGMEM lechiffre_logo[] = {
59 // 'base', 32x128px 99 // 'lechiffre_logo', 32x20px
60 0x00, 0x00, 0x80, 0x7c, 0x02, 0x01, 0x01, 0x80, 0x00, 0xe0, 0x50, 0x28, 0x98, 0x00, 0x00, 0x00, 0x00, 100 0x00, 0x3e, 0x20, 0x20, 0x00, 0x18, 0x2c, 0xa8, 0x80, 0x00, 0x1c, 0x22, 0x22, 0x00, 0x3e, 0x08,
61 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1010x30, 0x00, 0x34, 0x00, 0x3c, 0x0a, 0x00, 0xbc, 0x8a, 0x00, 0x38, 0x08, 0x00, 0x18, 0x2c, 0x28,
62 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x40, 0x41, 0x41, 0x41, 0xc0, 0x00, 0x00, 0x00, 0x00, 1020x00, 0xb6, 0xb6, 0x00, 0xdb, 0xdb, 0x00, 0x6d, 0x6d, 0x00, 0xdb, 0xdb, 0x00, 0xdb, 0xdb, 0x00,
63 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1030x00, 0xdb, 0xdb, 0x00, 0xdb, 0xdb, 0x00, 0x6d, 0x6d, 0x00, 0xdb, 0xdb, 0x00, 0xb6, 0xb6, 0x00,
64 0x00, 0x00, 0x00, 0x00, 0x3e, 0x41, 0x40, 0x40, 0x40, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 1040x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00,
65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 1050x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00
66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x10, 0x08, 0x08, 0x00, 0x00, 0x00,
67 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x07, 0x02, 0x39, 0x27, 0x10, 0x00, 0x00, 0x00,
69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x10, 0x00,
71 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
72 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x13, 0x00, 0x00,
73 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
74 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xfc,
75 0x22, 0x21, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
76 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x60, 0x1f, 0x00,
77 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
78 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
79 0x00, 0x90, 0x7e, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40,
81 0x30, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
82 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
83 0x00, 0x00, 0x00, 0x00, 0x08, 0xe4, 0x1c, 0x08, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
86 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
87 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x4a, 0x26, 0x00, 0x00, 0x00, 0x00,
88 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
89 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
90 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
91 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
92 };
93
94static const char PROGMEM base_caps_logo[] = {
95 // 'caps', 32x128px
96 0x00, 0x00, 0x80, 0x7c, 0x02, 0x01, 0x01, 0x80, 0x00, 0xe0, 0x50, 0x28, 0x98, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
98 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x80, 0x40, 0x41, 0x41, 0x41, 0xc0, 0x00, 0x00, 0x00, 0x00,
99 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x3e, 0x41, 0x40, 0x40, 0x40, 0x40, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
101 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x10, 0x08, 0x08, 0x00, 0x00, 0x00,
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x07, 0x02, 0x39, 0x27, 0x10, 0x00, 0x00, 0x00,
105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x10, 0x00,
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x13, 0x00, 0x00,
109 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xfc,
111 0x22, 0x21, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
112 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x60, 0x1f, 0x00,
113 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
114 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
115 0x00, 0x90, 0x7e, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
116 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40,
117 0x30, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
118 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
119 0x00, 0x00, 0x00, 0x00, 0x08, 0xe4, 0x1c, 0x08, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
120 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
122 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x54, 0x4a, 0x26, 0x00, 0x00, 0x00, 0x00,
124 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x10, 0x10, 0x10, 0x30, 0x00, 0x00, 0x80,
125 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
126 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x1e, 0x11, 0x09, 0x08,
127 0x1e, 0x11, 0x81, 0x7d, 0x13, 0x11, 0x08, 0x17, 0x11, 0x12, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00
128}; 106};
129 107
130 switch (get_highest_layer(layer_state)) { 108 oled_write_raw_P(lechiffre_logo, sizeof(lechiffre_logo));
131 case _BASE: 109}
132 if (host_keyboard_led_state().caps_lock) { 110
133 oled_write_raw_P(base_caps_logo, sizeof(base_caps_logo)); 111static void render_layer_status(void) {
134 } else { 112 oled_write_P(PSTR("-----"), false);
135 oled_write_raw_P(base_logo, sizeof(base_logo)); 113 switch (get_highest_layer(layer_state)) {
114 case _BASE:
115 oled_write_ln_P(PSTR("BASE"), false);
116 break;
117 case _NUM_SYM:
118 oled_write_ln_P(PSTR(" SYM"), false);
119 break;
120 case _NAV:
121 oled_write_ln_P(PSTR(" NAV"), false);
122 break;
123 default:
124 oled_write_ln_P(PSTR("?????"), false);
125 }
126}
127
128# define KEYLOG_LEN 11
129char keylog_str[KEYLOG_LEN] = {};
130uint8_t keylogs_str_idx = 0;
131uint16_t log_timer = 0;
132
133const char code_to_name[60] = {
134 ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
135 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
136 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
137 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
138 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
139 '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
140
141void add_keylog(uint16_t keycode) {
142 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
143 keycode = keycode & 0xFF;
144 }
145
146 for (uint8_t i = KEYLOG_LEN - 1; i > 0; i--) {
147 keylog_str[i] = keylog_str[i - 1];
148 }
149 if (keycode < 60) {
150 keylog_str[0] = code_to_name[keycode];
136 } 151 }
137 break; 152 keylog_str[KEYLOG_LEN - 1] = 0;
138 default: 153
139 oled_write_raw_P(base_logo, sizeof(base_logo)); 154 log_timer = timer_read();
155}
156
157void update_log(void) {
158 if (timer_elapsed(log_timer) > 750) {
159 add_keylog(0);
140 } 160 }
141} 161}
162
163//Text only renders
164void render_keylogger_status(void) {
165 oled_write_P(PSTR("-----"), false);
166 oled_write(keylog_str, false);
167}
168
169void render_keylock_status(led_t led_state) {
170 oled_write_P(PSTR("-----"), false);
171 oled_write_P(PSTR("C"), led_state.caps_lock);
172 oled_write_P(PSTR(" "), false);
173 oled_write_P(PSTR("N"), led_state.num_lock);
174 oled_write_P(PSTR(" "), false);
175 oled_write_P(PSTR("S"), led_state.scroll_lock);
176 //oled_write_ln_P(PSTR(" "), false);
177}
178
179void render_mod_status(uint8_t modifiers) {
180 oled_write_P(PSTR("-----"), false);
181 oled_write_ln_P(PSTR("SHFT"), (modifiers & MOD_MASK_SHIFT));
182 oled_write_ln_P(PSTR("ALT"), (modifiers & MOD_MASK_ALT));
183 oled_write_ln_P(PSTR("CTRL"), (modifiers & MOD_MASK_CTRL));
184 oled_write_ln_P(PSTR("GUI"), (modifiers & MOD_MASK_GUI));
185}
186
187void oled_task_user(void) {
188 render_lechiffre_logo();
189 oled_set_cursor(0,3);
190 render_layer_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
191 render_mod_status(get_mods()|get_oneshot_mods());
192 render_keylock_status(host_keyboard_led_state());
193 render_keylogger_status();
194}
195
196bool process_record_user(uint16_t keycode, keyrecord_t *record) {
197 if (record->event.pressed) {
198 add_keylog(keycode);
199 }
200 return true;
201 }
142#endif 202#endif
diff --git a/keyboards/le_chiffre/keymaps/default/rules.mk b/keyboards/le_chiffre/keymaps/default/rules.mk
new file mode 100644
index 000000000..ab1e43818
--- /dev/null
+++ b/keyboards/le_chiffre/keymaps/default/rules.mk
@@ -0,0 +1 @@
COMBO_ENABLE = yes
diff --git a/keyboards/le_chiffre/keymaps/via/keymap.c b/keyboards/le_chiffre/keymaps/via/keymap.c
new file mode 100644
index 000000000..485fa1b72
--- /dev/null
+++ b/keyboards/le_chiffre/keymaps/via/keymap.c
@@ -0,0 +1,161 @@
1/* Copyright 2020 tominabox1
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
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT(
20 KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MPLY, KC_Y, KC_U, KC_I, KC_O, KC_P,
21 KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
22 KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
23 KC_LCTL, KC_ENT, KC_SPC, KC_RALT
24 ),
25
26 [1] = LAYOUT(
27 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
29 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
31 ),
32
33 [2] = LAYOUT(
34 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
37 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
38 ),
39};
40
41void encoder_update_user(uint8_t index, bool clockwise) {
42 if (index == 0) {
43 if (clockwise) {
44 tap_code(KC_MNXT);
45 } else {
46 tap_code(KC_MPRV);
47 }
48 }
49}
50
51#ifdef OLED_DRIVER_ENABLE //Special thanks to Sickbabies for this great OLED widget!
52oled_rotation_t oled_init_user(oled_rotation_t rotation) {
53 return OLED_ROTATION_90; // rotates for proper orientation
54}
55
56void render_lechiffre_logo(void) {
57 static const char PROGMEM lechiffre_logo[] = {
58 // 'lechiffre_logo', 32x20px
59 0x00, 0x3e, 0x20, 0x20, 0x00, 0x18, 0x2c, 0xa8, 0x80, 0x00, 0x1c, 0x22, 0x22, 0x00, 0x3e, 0x08,
600x30, 0x00, 0x34, 0x00, 0x3c, 0x0a, 0x00, 0xbc, 0x8a, 0x00, 0x38, 0x08, 0x00, 0x18, 0x2c, 0x28,
610x00, 0xb6, 0xb6, 0x00, 0xdb, 0xdb, 0x00, 0x6d, 0x6d, 0x00, 0xdb, 0xdb, 0x00, 0xdb, 0xdb, 0x00,
620x00, 0xdb, 0xdb, 0x00, 0xdb, 0xdb, 0x00, 0x6d, 0x6d, 0x00, 0xdb, 0xdb, 0x00, 0xb6, 0xb6, 0x00,
630x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00,
640x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00
65};
66
67 oled_write_raw_P(lechiffre_logo, sizeof(lechiffre_logo));
68}
69
70// static void render_layer_status(void) {
71// oled_write_P(PSTR("-----"), false);
72// switch (get_highest_layer(layer_state)) {
73// case _BASE:
74// oled_write_ln_P(PSTR("BASE"), false);
75// break;
76// case _NUM_SYM:
77// oled_write_ln_P(PSTR(" SYM"), false);
78// break;
79// case _NAV:
80// oled_write_ln_P(PSTR(" NAV"), false);
81// break;
82// default:
83// oled_write_ln_P(PSTR("?????"), false);
84// }
85// }
86
87# define KEYLOG_LEN 11
88char keylog_str[KEYLOG_LEN] = {};
89uint8_t keylogs_str_idx = 0;
90uint16_t log_timer = 0;
91
92const char code_to_name[60] = {
93 ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
94 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
95 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
96 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
97 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
98 '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
99
100void add_keylog(uint16_t keycode) {
101 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) {
102 keycode = keycode & 0xFF;
103 }
104
105 for (uint8_t i = KEYLOG_LEN - 1; i > 0; i--) {
106 keylog_str[i] = keylog_str[i - 1];
107 }
108 if (keycode < 60) {
109 keylog_str[0] = code_to_name[keycode];
110 }
111 keylog_str[KEYLOG_LEN - 1] = 0;
112
113 log_timer = timer_read();
114}
115
116void update_log(void) {
117 if (timer_elapsed(log_timer) > 750) {
118 add_keylog(0);
119 }
120}
121
122//Text only renders
123void render_keylogger_status(void) {
124 oled_write_P(PSTR("-----"), false);
125 oled_write(keylog_str, false);
126}
127
128void render_keylock_status(led_t led_state) {
129 oled_write_P(PSTR("-----"), false);
130 oled_write_P(PSTR("C"), led_state.caps_lock);
131 oled_write_P(PSTR(" "), false);
132 oled_write_P(PSTR("N"), led_state.num_lock);
133 oled_write_P(PSTR(" "), false);
134 oled_write_P(PSTR("S"), led_state.scroll_lock);
135 //oled_write_ln_P(PSTR(" "), false);
136}
137
138void render_mod_status(uint8_t modifiers) {
139 oled_write_P(PSTR("-----"), false);
140 oled_write_ln_P(PSTR("SHFT"), (modifiers & MOD_MASK_SHIFT));
141 oled_write_ln_P(PSTR("ALT"), (modifiers & MOD_MASK_ALT));
142 oled_write_ln_P(PSTR("CTRL"), (modifiers & MOD_MASK_CTRL));
143 oled_write_ln_P(PSTR("GUI"), (modifiers & MOD_MASK_GUI));
144}
145
146void oled_task_user(void) {
147 render_lechiffre_logo();
148 oled_set_cursor(0,3);
149 // render_layer_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
150 render_mod_status(get_mods()|get_oneshot_mods());
151 render_keylock_status(host_keyboard_led_state());
152 render_keylogger_status();
153}
154
155bool process_record_user(uint16_t keycode, keyrecord_t *record) {
156 if (record->event.pressed) {
157 add_keylog(keycode);
158 }
159 return true;
160 }
161#endif
diff --git a/keyboards/le_chiffre/keymaps/via/rules.mk b/keyboards/le_chiffre/keymaps/via/rules.mk
new file mode 100644
index 000000000..1e5b99807
--- /dev/null
+++ b/keyboards/le_chiffre/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes
diff --git a/keyboards/le_chiffre/le_chiffre.c b/keyboards/le_chiffre/le_chiffre.c
index 2f28911b4..eae62ce02 100644
--- a/keyboards/le_chiffre/le_chiffre.c
+++ b/keyboards/le_chiffre/le_chiffre.c
@@ -1 +1,31 @@
1/* Copyright 2020 tominabox1
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 */
1#include "le_chiffre.h" 16#include "le_chiffre.h"
17
18led_config_t g_led_config = { {
19 // Key Matrix to LED Index
20 { 3, 4, NO_LED, 5, 6 },
21 { NO_LED, NO_LED, 10, NO_LED, NO_LED },
22 { NO_LED, NO_LED, 9, NO_LED, NO_LED },
23 { 2, 1, 0, 8, 7 }
24}, {
25
26 // LED Index to Physical Position
27 { 128, 64 }, { 77, 64 }, { 0, 48 }, { 0, 0 }, { 115, 0 }, { 166, 0 }, { 255, 0 }, { 255, 48 }, { 178, 64 }, { 128, 40 }, { 128, 30 }
28}, {
29
30 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
31} };
diff --git a/keyboards/le_chiffre/le_chiffre.h b/keyboards/le_chiffre/le_chiffre.h
index a95c0f262..0277e1b42 100644
--- a/keyboards/le_chiffre/le_chiffre.h
+++ b/keyboards/le_chiffre/le_chiffre.h
@@ -1,3 +1,18 @@
1/* Copyright 2020 tominabox1
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 */
1#pragma once 16#pragma once
2 17
3#include "quantum.h" 18#include "quantum.h"
diff --git a/keyboards/le_chiffre/rules.mk b/keyboards/le_chiffre/rules.mk
index d9d44e06e..2d3a50ca1 100644
--- a/keyboards/le_chiffre/rules.mk
+++ b/keyboards/le_chiffre/rules.mk
@@ -11,12 +11,15 @@ MCU = atmega32u4
11# ATmega328P USBasp 11# ATmega328P USBasp
12BOOTLOADER = atmel-dfu 12BOOTLOADER = atmel-dfu
13 13
14BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration 14BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
15MOUSEKEY_ENABLE = yes # Mouse keys 15MOUSEKEY_ENABLE = yes # Mouse keys
16EXTRAKEY_ENABLE = yes # Audio control and System control 16EXTRAKEY_ENABLE = yes # Audio control and System control
17SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 17SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
18NKRO_ENABLE = yes # USB Nkey Rollover 18NKRO_ENABLE = yes # USB Nkey Rollover
19RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow 19RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
20TAP_DANCE_ENABLE = no 20TAP_DANCE_ENABLE = no
21ENCODER_ENABLE = yes 21ENCODER_ENABLE = yes
22OLED_DRIVER_ENABLE = no 22OLED_DRIVER_ENABLE = no
23RGB_MATRIX_ENABLE = yes
24RGB_MATRIX_DRIVER = WS2812
25LTO_ENABLE = yes