forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lily58 based on existing VIA config (qmk#108)
- Loading branch information
Showing
4 changed files
with
377 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
This is the c configuration file for the keymap | ||
Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
Copyright 2015 Jack Humbert | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#pragma once | ||
|
||
/* VIAL UID for Lily58*/ | ||
#define VIAL_KEYBOARD_UID {0x7E, 0xFD, 0xFC, 0x5B, 0x7D, 0x39, 0x48, 0x06} | ||
|
||
/* VIAL secure unlock keystroke - currently both big keys (typ. SPACE/ENTER) */ | ||
#define VIAL_UNLOCK_COMBO_ROWS {4, 9} | ||
#define VIAL_UNLOCK_COMBO_COLS {4, 4} | ||
|
||
/* Space reduction */ | ||
|
||
#define DYNAMIC_KEYMAP_LAYER_COUNT 6 | ||
#define VIAL_TAP_DANCE_ENTRIES 4 | ||
#undef LOCKING_SUPPORT_ENABLE | ||
#undef LOCKING_RESYNC_ENABLE | ||
#define NO_ACTION_ONESHOT | ||
|
||
/* Select hand configuration */ | ||
|
||
#define MASTER_LEFT | ||
// #define MASTER_RIGHT | ||
// #define EE_HANDS | ||
|
||
#define USE_SERIAL_PD2 | ||
|
||
#define TAPPING_FORCE_HOLD | ||
#define TAPPING_TERM 100 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,273 @@ | ||
/* Copyright 2020 Naoki Katahira | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include QMK_KEYBOARD_H | ||
#include <stdio.h> | ||
|
||
enum layer_number { | ||
_QWERTY = 0, | ||
_LOWER, | ||
_RAISE, | ||
_ADJUST, | ||
_MO4, | ||
_MO5 | ||
}; | ||
|
||
#define RAISE MO(_RAISE) | ||
#define LOWER MO(_LOWER) | ||
|
||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
|
||
/* QWERTY | ||
* ,-----------------------------------------. ,-----------------------------------------. | ||
* | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ~ | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | Tab | Q | W | E | R | T | | Y | U | I | O | P | - | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* |LCTRL | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | | ||
* |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| | ||
* |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| | ||
* `-----------------------------------------/ / \ \-----------------------------------------' | ||
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | | ||
* | | | |/ / \ \ | | | | | ||
* `-------------------''-------' '------''--------------------' | ||
*/ | ||
|
||
[_QWERTY] = LAYOUT( | ||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, | ||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, | ||
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
LOWER, KC_LGUI, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, RAISE | ||
), | ||
/* LOWER | ||
* ,-----------------------------------------. ,-----------------------------------------. | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | 1 | 2 | 3 | 4 | 5 |-------. ,-------| 6 | 7 | 8 | 9 | 0 | | | ||
* |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| | ||
* | | | | | | |-------| |-------| | | ` | + | { | } | | | ||
* `-----------------------------------------/ / \ \-----------------------------------------' | ||
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | | ||
* | | | |/ / \ \ | | | | | ||
* `-------------------''-------' '------''--------------------' | ||
*/ | ||
[_LOWER] = LAYOUT( | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, | ||
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, | ||
_______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_GRAVE, KC_PLUS, KC_LCBR, KC_RCBR, _______, | ||
_______, _______, _______, _______, _______, _______, _______, _______ | ||
), | ||
/* RAISE | ||
* ,-----------------------------------------. ,-----------------------------------------. | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | | | | | |-------. ,-------| | Left | Down | Up |Right | | | ||
* |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| | ||
* | | | | | | |-------| |-------| + | = | [ | ] | \ | | | ||
* `-----------------------------------------/ / \ \-----------------------------------------' | ||
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | | ||
* | | | |/ / \ \ | | | | | ||
* `-------------------''-------' '------''--------------------' | ||
*/ | ||
|
||
[_RAISE] = LAYOUT( | ||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, | ||
_______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, | ||
_______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, | ||
_______, _______, _______, _______, _______, _______, _______, _______ | ||
), | ||
|
||
/* ADJUST | ||
* ,-----------------------------------------. ,-----------------------------------------. | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | | | | | |-------. ,-------| | | | | | | | ||
* |------+------+------+------+------+------| | | |------+------+------+------+------+------| | ||
* | | | | | | |-------| |-------| | | | | | | | ||
* `-----------------------------------------/ / \ \-----------------------------------------' | ||
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | | ||
* | | | |/ / \ \ | | | | | ||
* `----------------------------' '------''--------------------' | ||
*/ | ||
[_ADJUST] = LAYOUT( | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
_______, _______, _______, _______, _______, _______, _______, _______ | ||
), | ||
/* MO(4) | ||
* ,-----------------------------------------. ,-----------------------------------------. | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | | | | | |-------. ,-------| | | | | | | | ||
* |------+------+------+------+------+------| | | |------+------+------+------+------+------| | ||
* | | | | | | |-------| |-------| | | | | | | | ||
* `-----------------------------------------/ / \ \-----------------------------------------' | ||
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | | ||
* | | | |/ / \ \ | | | | | ||
* `----------------------------' '------''--------------------' | ||
*/ | ||
[_MO4] = LAYOUT( | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
_______, _______, _______, _______, _______, _______, _______, _______ | ||
), | ||
/* MO(5) | ||
* ,-----------------------------------------. ,-----------------------------------------. | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | | | | | | | | | | | | | | ||
* |------+------+------+------+------+------| |------+------+------+------+------+------| | ||
* | | | | | | |-------. ,-------| | | | | | | | ||
* |------+------+------+------+------+------| | | |------+------+------+------+------+------| | ||
* | | | | | | |-------| |-------| | | | | | | | ||
* `-----------------------------------------/ / \ \-----------------------------------------' | ||
* |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | | ||
* | | | |/ / \ \ | | | | | ||
* `----------------------------' '------''--------------------' | ||
*/ | ||
[_MO5] = LAYOUT( | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, | ||
_______, _______, _______, _______, _______, _______, _______, _______ | ||
) | ||
}; | ||
|
||
#ifdef OLED_ENABLE | ||
|
||
oled_rotation_t oled_init_user(oled_rotation_t rotation) { | ||
if (!is_keyboard_master()) | ||
return OLED_ROTATION_180; // flips the display 180 degrees if offhand | ||
return rotation; | ||
} | ||
|
||
layer_state_t layer_state_set_user(layer_state_t state) { | ||
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); | ||
return state; | ||
} | ||
|
||
static void render_logo(void) { | ||
|
||
static const char PROGMEM logo[] = { | ||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, | ||
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, | ||
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00 | ||
}; | ||
|
||
oled_write_P(logo, false); | ||
} | ||
|
||
char keylog_str[24] = {}; | ||
char keylogs_str[21] = {}; | ||
int keylogs_str_idx = 0; | ||
|
||
char wpm[4]; | ||
char layer_misc[7]; | ||
|
||
const char code_to_name[60] = { | ||
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', | ||
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', | ||
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', | ||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', | ||
'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', | ||
'#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; | ||
|
||
void set_keylog(uint16_t keycode, keyrecord_t *record) { | ||
char name = ' '; | ||
if (keycode < 60) { | ||
name = code_to_name[keycode]; | ||
} | ||
|
||
// update keylog | ||
snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", | ||
record->event.key.row, record->event.key.col, | ||
keycode, name); | ||
|
||
// update keylogs | ||
if (keylogs_str_idx == sizeof(keylogs_str) - 1) { | ||
keylogs_str_idx = 0; | ||
for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { | ||
keylogs_str[i] = ' '; | ||
} | ||
} | ||
|
||
keylogs_str[keylogs_str_idx] = name; | ||
keylogs_str_idx++; | ||
} | ||
|
||
const char *read_keylog(void) { | ||
return keylog_str; | ||
} | ||
|
||
const char *read_keylogs(void) { | ||
return keylogs_str; | ||
} | ||
|
||
static void render_status(void) { | ||
oled_write_P(PSTR("layer "), false); | ||
|
||
switch (get_highest_layer(layer_state)) { | ||
case _QWERTY: | ||
oled_write_P(PSTR("QWERTY"), false); | ||
break; | ||
case _LOWER: | ||
oled_write_P(PSTR("Lower "), false); | ||
break; | ||
case _RAISE: | ||
oled_write_P(PSTR("Raise "), false); | ||
break; | ||
case _ADJUST: | ||
oled_write_P(PSTR("Adjust"), false); | ||
break; | ||
default: | ||
sprintf(layer_misc, "MO(%01d) ", get_highest_layer(layer_state)); | ||
oled_write(layer_misc, false); | ||
break; | ||
} | ||
|
||
oled_write_P(PSTR(" "), false); | ||
sprintf(wpm, "%03d", get_current_wpm()); | ||
oled_write(wpm, false); | ||
oled_write_P(PSTR(" wpm\n"), false); | ||
} | ||
|
||
bool oled_task_user(void) { | ||
if (is_keyboard_master()) { | ||
render_status(); | ||
} else { | ||
render_logo(); | ||
} | ||
return false; | ||
} | ||
|
||
#endif // OLED_ENABLE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
VIA_ENABLE = yes | ||
VIAL_ENABLE = yes | ||
OLED_ENABLE = yes | ||
OLED_DRIVER = SSD1306 | ||
MOUSEKEY_ENABLE = no | ||
EXTRAKEY_ENABLE = yes | ||
WPM_ENABLE = yes | ||
TAP_DANCE_ENABLE = yes | ||
COMBO_ENABLE = no | ||
GRAVE_ESC_ENABLE = no | ||
MAGIC_ENABLE = no | ||
BOOTMAGIC_ENABLE = no | ||
|
||
COMMAND_ENABLE = no | ||
CONSOLE_ENABLE = no | ||
|
||
QMK_SETTINGS = yes | ||
LTO_ENABLE = yes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "Lily58", | ||
"vendorId": "0x04D8", | ||
"productId": "0xEB2D", | ||
"lighting": "none", | ||
"matrix": { "rows": 10, "cols": 6 }, | ||
"layouts": { | ||
"labels": [], | ||
"keymap": [ | ||
[{"x":3.5},"0,3",{"x":8.5},"5,3"], | ||
[{"y":-0.875,"x":2.5},"0,2",{"x":1},"0,4",{"x":6.5},"5,4",{"x":1},"5,2"], | ||
[{"y":-0.875,"x":5.5},"0,5",{"x":4.5},"5,5"], | ||
[{"y":-0.875,"x":1.5},"0,1",{"x":12.5},"5,1"], | ||
[{"y":-0.875,"x":0.5,"c":"#777777"},"0,0",{"x":14.5,"c":"#cccccc"},"5,0"], | ||
[{"y":-0.5,"x":3.5},"1,3",{"x":8.5},"6,3"], | ||
[{"y":-0.875,"x":2.5},"1,2",{"x":1},"1,4",{"x":6.5},"6,4",{"x":1},"6,2"], | ||
[{"y":-0.875,"x":5.5},"1,5",{"x":4.5},"6,5"], | ||
[{"y":-0.875,"x":1.5},"1,1",{"x":12.5},"6,1"], | ||
[{"y":-0.875,"x":0.5,"c":"#aaaaaa"},"1,0",{"x":14.5,"c":"#cccccc"},"6,0"], | ||
[{"y":-0.5,"x":3.5},"2,3",{"x":8.5},"7,3"], | ||
[{"y":-0.875,"x":2.5},"2,2",{"x":1},"2,4",{"x":6.5},"7,4",{"x":1},"7,2"], | ||
[{"y":-0.875,"x":5.5},"2,5",{"x":4.5},"7,5"], | ||
[{"y":-0.875,"x":1.5},"2,1",{"x":12.5},"7,1"], | ||
[{"y":-0.875,"x":0.5,"c":"#aaaaaa"},"2,0",{"x":14.5,"c":"#cccccc"},"7,0"], | ||
[{"y":-0.75,"x":6.5},"4,5",{"x":2.5},"9,5"], | ||
[{"y":-0.75,"x":3.5},"3,3",{"x":8.5},"8,3"], | ||
[{"y":-0.875,"x":2.5},"3,2",{"x":1},"3,4",{"x":6.5},"8,4",{"x":1},"8,2"], | ||
[{"y":-0.875,"x":5.5},"3,5",{"x":4.5},"8,5"], | ||
[{"y":-0.875,"x":1.5},"3,1",{"x":12.5},"8,1"], | ||
[{"y":-0.875,"x":0.5,"c":"#aaaaaa"},"3,0",{"x":14.5},"8,0"], | ||
[{"y":-0.375,"x":3},"4,1"], | ||
[{"y":-0.975,"x":4},"4,2",{"x":7.5},"9,2","9,1"], | ||
[{"y":-0.9,"x":5},"4,3",{"x":0.5,"c":"#777777","h":1.5},"4,4",{"x":2.5,"h":1.5},"9,4",{"x":0.5,"c":"#aaaaaa"},"9,3"] | ||
] | ||
} | ||
} |