1
0
Fork 0

New keymap for Sofle rev1 for Flare576 (#13723)

* feat(sofle): add flare576 keymap to sofle

* feat(sofle): add flare576 keymap to sofle

* luna on main

* fix(flare576): Final layout for now

* WIP

* chore(graphics): file split

* fix(oled): display issues

Always show mode changes
Remove unused variable

* feat(marquee): Scrolling logo

* fix(TG TO): Better layer swapping

* feat(readme): Update for Flare576 keybinds

* chore(license): add license

* fix(logos): simplify loop/data

* fix(logos): simplify loop/data

* fix(logos): better quality

* feat(size): remove unused layers, split images

Remove Npad, media, add meta and FF14
Add flag (MAIN_BOARD) for main/secondary graphics
Add Chocobo image

* feat(size): remove unused layers, split images

Remove Npad, media, rename game to esdf, add FF14
Add flag (MAIN_BOARD) for main/secondary graphics
Add Chocobo image

* fix(headers): PR feedback

Rename to enums.h
Fix defines
Fix last commit (hanging refs)

* chore(graphics): manage large strings better

* fix(incremental): updating keymaps

* fix(syms): Bracket idea

* fix(esdf): Map (M) key to bottom right

* PR Feedback RE: headers

* docs(readme): old information updated

* fix(licenses): add license info to new files
This commit is contained in:
Jeremy Scherer 2021-12-27 04:05:40 -06:00 committed by GitHub
parent 24f33460a2
commit ce0ca94600
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 701 additions and 0 deletions

View file

@ -0,0 +1,40 @@
/* Copyright 2021 Flare576 <flare576@gmail.com>
*
* 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
#define MAIN_BOARD
#define MASTER_RIGHT
#define ENCODER_DIRECTION_FLIP
#define OLED_TIMEOUT 10000
#define MOUSEKEY_INTERVAL 16
#define MOUSEKEY_DELAY 0
#define MOUSEKEY_TIME_TO_MAX 60
#define MOUSEKEY_MAX_SPEED 7
#define MOUSEKEY_WHEEL_DELAY 0
#define TAPPING_TERM_PER_KEY
#ifdef ENCODER_RESOLUTION
#undef ENCODER_RESOLUTION
#endif
#define ENCODER_RESOLUTION 4
#ifdef TAPPING_TERM
#undef TAPPING_TERM
#endif
#define TAPPING_TERM 200
#undef MANUFACTURER
#define MANUFACTURER Flare576

View file

@ -0,0 +1,34 @@
/* Copyright 2021 Flare576 <flare576@gmail.com>
*
* 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
enum _layers {
/* _M_XYZ = Mac Os, _W_XYZ = Win/Linux */
_BASE,
_MOUS,
_SYMS,
_FF14,
_ESDF,
};
enum custom_keycodes {
_COMP1 = SAFE_RANGE,
_COMP2,
};
enum custom_tapdance {
TD_PLAY,
TD_HOME,
};

View file

@ -0,0 +1,290 @@
/* Copyright 2021 Flare576 <flare576@gmail.com>
*
* 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 "enums.h"
#include "logos.h"
int current_wpm = -1; // Enable screen-on at startup
bool isJumping = false;
bool showedJump = true;
#ifdef OLED_DRIVER_ENABLE
#ifdef MAIN_BOARD
static void render_logos(void){}
void luna_jump(bool newJump){
isJumping = newJump;
if (newJump) {
showedJump = false;
}
}
// START Luna vars
#define MIN_WALK_SPEED 10
#define MIN_RUN_SPEED 40
#define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
#define ANIM_SIZE 96 // number of bytes in array, minimize for adequate firmware size, max is 1024
uint32_t anim_timer = 0;
uint8_t current_frame = 0;
bool isSneaking = false;
static void render_luna(int LUNA_X, int LUNA_Y) {
static const char PROGMEM sit[2][ANIM_SIZE] = {
// 'sit1', 32x22px
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c,
0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x68, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28,
0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
// 'sit2', 32x22px
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1c,
0x02, 0x05, 0x02, 0x24, 0x04, 0x04, 0x02, 0xa9, 0x1e, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x90, 0x08, 0x18, 0x60, 0x10, 0x08, 0x04, 0x03, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0e, 0x82, 0x7c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0c, 0x10, 0x10, 0x20, 0x20, 0x20, 0x28,
0x3e, 0x1c, 0x20, 0x20, 0x3e, 0x0f, 0x11, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
};
static const char PROGMEM walk[2][ANIM_SIZE] = {
// 'walk1', 32x22px
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x90, 0x90, 0x90, 0xa0, 0xc0, 0x80, 0x80,
0x80, 0x70, 0x08, 0x14, 0x08, 0x90, 0x10, 0x10, 0x08, 0xa4, 0x78, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x18, 0xea, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x03,
0x06, 0x18, 0x20, 0x20, 0x3c, 0x0c, 0x12, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
},
// 'walk2', 32x22px
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x20, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00,
0x00, 0xe0, 0x10, 0x28, 0x10, 0x20, 0x20, 0x20, 0x10, 0x48, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x20, 0xf8, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x30, 0xd5, 0x20, 0x1f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e,
0x02, 0x1c, 0x14, 0x08, 0x10, 0x20, 0x2c, 0x32, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}
};
static const char PROGMEM run[2][ANIM_SIZE] = {
// 'run1', 32x22px
{
0x00, 0x00, 0x00, 0x00, 0xe0, 0x10, 0x08, 0x08, 0xc8, 0xb0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x40, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0xc4, 0xa4, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc8, 0x58, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x09, 0x04, 0x04, 0x04, 0x04, 0x02, 0x03, 0x02, 0x01, 0x01,
0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
},
// 'run2', 32x22px
{
0x00, 0x00, 0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x80, 0x80, 0x78, 0x28, 0x08, 0x10, 0x20, 0x30, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x04, 0x08, 0x10, 0x11, 0xf9, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0xb0, 0x50, 0x55, 0x20, 0x1f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37,
0x02, 0x1e, 0x20, 0x20, 0x18, 0x0c, 0x14, 0x1e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}
};
static const char PROGMEM sneak[2][ANIM_SIZE] = {
// 'sneak1', 32x22px
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x40, 0x40, 0x80, 0x00, 0x80, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1e, 0x21, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x04,
0x04, 0x04, 0x03, 0x01, 0x00, 0x00, 0x09, 0x01, 0x80, 0x80, 0xab, 0x04, 0xf8, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x20, 0x20, 0x3c, 0x0f, 0x11, 0x1f, 0x02, 0x06,
0x18, 0x20, 0x20, 0x38, 0x08, 0x10, 0x18, 0x04, 0x04, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00,
},
// 'sneak2', 32x22px
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xa0, 0x20, 0x40, 0x80, 0xc0, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3e, 0x41, 0xf0, 0x04, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02, 0x02, 0x04,
0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, 0x40, 0x55, 0x82, 0x7c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x30, 0x0c, 0x02, 0x05, 0x09, 0x12, 0x1e, 0x04,
0x18, 0x10, 0x08, 0x10, 0x20, 0x28, 0x34, 0x06, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
}
};
// animation state
void animation_phase(void) {
if (isJumping || !showedJump) {
// clear
oled_set_cursor(LUNA_X,LUNA_Y +2);
oled_write(" ", false);
oled_set_cursor(LUNA_X,LUNA_Y -1);
showedJump = true;
} else {
// clear
oled_set_cursor(LUNA_X,LUNA_Y -1);
oled_write(" ", false);
oled_set_cursor(LUNA_X,LUNA_Y);
}
current_frame = (current_frame + 1) % 2;
if(isSneaking) {
oled_write_raw_P(sneak[abs(1 - current_frame)], ANIM_SIZE);
} else if(current_wpm <= MIN_WALK_SPEED) {
oled_write_raw_P(sit[abs(1 - current_frame)], ANIM_SIZE);
} else if(current_wpm <= MIN_RUN_SPEED) {
oled_write_raw_P(walk[abs(1 - current_frame)], ANIM_SIZE);
} else {
oled_write_raw_P(run[abs(1 - current_frame)], ANIM_SIZE);
}
}
// animation timer
if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
anim_timer = timer_read32();
animation_phase();
}
}
// END Luna vars
static void main_board(void) {
int layer = get_highest_layer(layer_state);
isSneaking = false;
// Print current mode
oled_write_ln_P(PSTR("Flare"), false);
oled_write_ln_P(PSTR("Sofle"), false);
if (layer == _FF14) {
oled_write_raw_P(ffxiv, 16*8);
} else if (keymap_config.swap_lalt_lgui) {
oled_write_raw_P(windows, 16*8);
} else {
oled_write_raw_P(apple, 16*8);
}
oled_set_cursor(0, 9);
switch (layer) {
case _BASE:
oled_write_ln_P(PSTR("ALL"), false);
oled_write_P(PSTR(" YOUR"), false);
oled_write_ln_P(PSTR("BASE"), false);
break;
case _MOUS:
isSneaking = true;
oled_write_ln_P(PSTR("Mouse"), false);
break;
case _SYMS:
oled_write_ln_P(PSTR("@$*&#"), false);
break;
case _FF14:
oled_write_ln_P(PSTR("FFXIV"), false);
break;
case _ESDF:
oled_write_ln_P(PSTR("ESDF "), false);
break;
default:
oled_write_ln_P(PSTR("Undef"), false);
}
if (layer != _BASE) {
oled_write_P(PSTR("\n"), false);
}
// Don't re-write if not in use
if (current_wpm > 0) {
render_luna(0,13);
}
}
// End "MAIN_BOARD"
#else
static void main_board(void){}
static void luna_jump(bool newJump){}
#define MARQUEE_FRAME_DURATION 200 // how long each frame lasts in ms
#define LOGO_BYTES 128
#define LOGO_COUNT 7
static const char *const secondary_logos[] = { js, apple, docker, python, qmk, brew, windows };
#define MARQUEE_FRAMES (LOGO_COUNT * 4)
#define MARQUEE_SIZE ( LOGO_COUNT * LOGO_BYTES)
#define MARQUEE_SCROLL_UP true
uint32_t marquee_timer = 0;
uint32_t marquee_frame = 0;
static void render_logos(void) {
void marquee_phase(void) {
marquee_frame = (marquee_frame + 1) % MARQUEE_FRAMES;
int marquee_start = MARQUEE_SIZE - (marquee_frame * 32);
static char output[MARQUEE_SIZE];
for (int i = 0; i < LOGO_COUNT; i++) {
for (int j = 0; j < LOGO_BYTES; j++) {
int pos = ( i * LOGO_BYTES + j + marquee_start ) % MARQUEE_SIZE;
output[pos] = pgm_read_byte_near(secondary_logos[i] + j);
}
}
oled_write_raw(output, MARQUEE_SIZE);
}
// animation timer
if(timer_elapsed32(marquee_timer) > MARQUEE_FRAME_DURATION) {
marquee_timer = timer_read32();
marquee_phase();
}
}
// End "MAIN_BOARD" false
#endif
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_270;
}
void oled_task_user(void) {
// Prevent blank screen on startup
if (current_wpm == -1) {
set_current_wpm(10);
}
current_wpm = get_current_wpm();
if (is_keyboard_master()) {
// can't gate main_board on wpm; won't get mode changes that don't trigger wpm
main_board();
} else if (current_wpm > 0) {
render_logos();
}
}
// End "OLED_DRIVER_ENABLE"
#else
static void luna_jump(bool newJump){}
// End "OLED_DRIVER_ENABLE" false
#endif

View file

@ -0,0 +1,16 @@
/* Copyright 2021 Flare576 <flare576@gmail.com>
*
* 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/>.
*/
void luna_jump(bool newJump);

View file

@ -0,0 +1,196 @@
/* Copyright 2021 Flare576 <flare576@gmail.com>
*
* 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 "print.h"
#include "enums.h"
#include "graphics.h"
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_PLAY] = ACTION_TAP_DANCE_DOUBLE(KC_MPLY, KC_MNXT),
[TD_HOME] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END),
};
#define KC_TPLY TD(TD_PLAY)
#define KC_THME TD(TD_HOME)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* BASE
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* |Alt/Tb| Q | W | E | R | T | | Y | U | I | O | P | \ |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* |LShift| A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' |
* |------+------+------+------+------+------| PLAY | | PAGE |------+------+------+------+------+------|
* |LCtrl | Z | X | C | V | B |-------| |-------| N | M | , | . | / |+/SHFT|
* `-----------------------------------------/ / \Enter \-----------------------------------------'
* | ESDF | LAlt | ESC/ | LGUI | /Space / \ or \ | Bspc | Alt+ |Delete|FFXIV |
* | | |Symbol| |/ / \Mouse \ | |Shift | | |
* `----------------------------------' '------''---------------------------'
*
* Note: Apple's keyboard settings don't seem to discern right- and left-ALT, so swapping keys there breaks TAB & META
*/
[_BASE] = LAYOUT(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
RALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TPLY, KC_THME, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_PLUS),
TG(_ESDF), KC_LALT, LT(_SYMS,KC_ESC), KC_LGUI, KC_SPC, LT(_MOUS, KC_ENT), KC_BSPC, RSFT(KC_RALT), KC_DEL, TG(_FF14)
),
/*
* MOUS
* ,-----------------------------------------. ,-----------------------------------------.
* |CTRL+W|ALT+A | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TRNS |PRNTSC| | M UP | HOME | PGUP | |M Wl U|M Wl D|M Wl L|M Wl R| |COMP1 |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TRNS |SC LCK|M LFT |M DWN |M RGHT| |-------. ,-------| UP | DOWN | LEFT |RIGHT | |COMP2 |
* |------+------+------+------+------+------| TRNS | | TRNS |------+------+------+------+------+------|
* | TRNS |PAUSE | | | END | PGDN |-------| |-------|MOUS1 |MOUS2 | | | | |
* `-----------------------------------------/ / \ \-----------------------------------------'
* | | TRNS | TRNS |TRNS | / TRNS / \ TRNS \ |MOUS3 |MOUS4 |MOUS5 | |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_MOUS] = LAYOUT(
LCTL(KC_W), LALT(KC_A), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, KC_PSCR, XXXXXXX, KC_MS_U, KC_HOME, KC_PGUP, KC_WH_U, KC_WH_D, KC_WH_L, KC_WH_R, XXXXXXX, _COMP1,
_______, KC_SLCK, KC_MS_L, KC_MS_D, KC_MS_R, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, _COMP2,
_______, KC_PAUS, XXXXXXX, XXXXXXX, KC_END, KC_PGDN, _______, _______, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, _______, _______, _______, _______, _______, KC_BTN3, KC_BTN4, KC_BTN5, XXXXXXX
),
/* SYMS
* ,-----------------------------------------. ,-----------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | | { | } | | RESET|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TRNS | F6 | F7 | F8 | F9 | F10 | | | | ( | ) | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TRNS | F11 | F12 | F13 | F14 | F15 |-------. ,-------| | | [ | ] | | |
* |------+------+------+------+------+------| TRNS | | TRNS |------+------+------+------+------+------|
| TRNS | UNDO | CUT | COPY |PASTE | F20 |-------| |-------| | | < | > | | |
* `-----------------------------------------/ / \ \-----------------------------------------'
* | TRNS | TRNS | TRNS | TRNS | / TRNS / \ TRNS \ | TRNS | TRNS | TRNS | TRNS |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_SYMS] = LAYOUT(
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, XXXXXXX, RESET,
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, XXXXXXX, KC_LPRN, KC_RPRN, XXXXXXX, XXXXXXX,
_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, XXXXXXX, XXXXXXX, KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX,
_______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), KC_F20, _______, _______, XXXXXXX, XXXXXXX, KC_LT, KC_GT, XXXXXXX, XXXXXXX,
XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX
),
/* FF14
* ,-----------------------------------------. ,-----------------------------------------.
* | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS | | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TAB | TRNS | TRNS | TRNS | TRNS | TRNS | | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |-------. ,-------| TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
* |------+------+------+------+------+------| TRNS | | TRNS |------+------+------+------+------+------|
* | TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |-------| |-------| TRNS | TRNS | TRNS | TRNS | TRNS | TRNS |
* `-----------------------------------------/ / \ \-----------------------------------------'
* | ESDF | | ESC | TRNS | / TRNS / \ TRNS \ | TRNS |PrntSc| TRNS | TRNS |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_FF14] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
TO(_ESDF), XXXXXXX, KC_ESC, _______, _______, _______, _______, KC_PSCR, _______, _______
),
/* ESDF
* ,-----------------------------------------. ,-----------------------------------------.
* | ~ | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | = |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | T | Tab | Q | W | E | R | | Ctl-Y| Ctl-U| Ctl-I| Ctl-O| Ctl-P| PGUP |
* |------|------+------+------+------+------+ |------+------+------+------+------+------|
* | G |LShift| A | S | D | F |-------. ,-------| Ctl-H| Ctl-J| Ctl-K| Ctl-L| Ctl-;| PGDN |
* |------|------+------+------+------+------+ | | |------+------+------+------+------+------|
* | LCtrl| Z | X | C | V | B |-------| |-------| Ctl-N| Ctl-M| Ctl-,| Ctl-.| Ctl-/| M |
* `-----------------------------------------/ / \Enter \-----------------------------------------'
* | TRNS | | ESC | LAlt | /Space / \ \ |PrnScr| | | FF14 |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_ESDF] = LAYOUT(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
KC_T, KC_TAB, KC_Q, KC_W, KC_E, KC_R, RCTL(KC_Y), RCTL(KC_U), RCTL(KC_I), RCTL(KC_O), RCTL(KC_P), KC_PGUP,
KC_G, KC_LSFT, KC_A, KC_S, KC_D, KC_F, RCTL(KC_H), RCTL(KC_J), RCTL(KC_K), RCTL(KC_L), RCTL(KC_SCLN), KC_PGDN,
KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, RCTL(KC_N), RCTL(KC_M), RCTL(KC_COMM), RCTL(KC_DOT), RCTL(KC_SLSH), KC_M,
_______, XXXXXXX, _______, _______, _______, _______, _______, KC_PSCR, _______, TO(_FF14)
)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case _COMP1:
if (record->event.pressed) {
// SEND_STRING(SS_TAP(X_RCTRL) SS_DELAY(100) SS_TAP(X_RCTRL) SS_DELAY(100) "1" SS_TAP(X_ENTER));
keymap_config.swap_lalt_lgui = false;
}
return false;
case _COMP2:
if (record->event.pressed) {
// SEND_STRING(SS_TAP(X_RCTRL) SS_DELAY(100) SS_TAP(X_RCTRL) SS_DELAY(100) "2" SS_TAP(X_ENTER));
keymap_config.swap_lalt_lgui = true;
}
return false;
case KC_SPC:
luna_jump(record->event.pressed);
break;
}
return true;
}
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_THME:
case KC_TPLY:
return TAPPING_TERM + 250;
default:
return TAPPING_TERM;
}
}
#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_VOLD);
} else {
tap_code(KC_VOLU);
}
} else if (index == 1) {
if (clockwise) {
tap_code(KC_PGDOWN);
} else {
tap_code(KC_PGUP);
}
}
return true;
}
#endif

View file

@ -0,0 +1,96 @@
/* Copyright 2021 Flare576 <flare576@gmail.com>
*
* 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/>.
*/
static const char PROGMEM ffxiv[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xf0, 0x00, 0xf0, 0xc0, 0xe0, 0x80, 0x00, 0x02,
0x0c, 0x2e, 0xfc, 0xfc, 0xfc, 0xfc, 0x78, 0x78, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x3f, 0x37, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xf8,
0xf8, 0xf8, 0xf1, 0xff, 0xff, 0xff, 0xf8, 0xf0, 0xf0, 0xb0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x7b, 0xdf, 0x1f, 0x3f, 0x3f,
0x1f, 0x1f, 0x3f, 0x5f, 0x9f, 0x8f, 0x07, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x06, 0x07, 0x0f, 0x1c, 0x74,
0x0c, 0x0d, 0x09, 0x09, 0x11, 0x01, 0x03, 0x03, 0x07, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00
};
static const char PROGMEM windows[] = {
0x00, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0xf8,
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfe, 0xfe, 0xfe, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0xfe,
0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00,
0x00, 0x07, 0x07, 0x07, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x1f, 0x1f, 0x00, 0x1f,
0x1f, 0x1f, 0x1f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x00
};
static const char PROGMEM apple[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xe0, 0x78, 0x7c, 0x7e, 0x3e, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe,
0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x0e, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f,
0x7f, 0x7f, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00
};
const char PROGMEM docker[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70,
0x70, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0xb0, 0xb0, 0xb0, 0x80, 0xb7, 0xb7, 0xb7, 0x80, 0xb7, 0xb7, 0xb7, 0x80, 0xb7,
0xb7, 0xb7, 0x80, 0xb0, 0xb0, 0xb0, 0x80, 0x80, 0xfe, 0xfe, 0xfc, 0xf0, 0xf0, 0xf0, 0x70, 0x00,
0x03, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03,
0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const char PROGMEM python[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x7e, 0x66, 0x66, 0x67, 0x7f, 0x7f, 0x7f,
0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfc, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf0, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3f, 0x9f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf0,
0x0f, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x03, 0xf9, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x7f, 0x3f, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x3f, 0x7f, 0x7f, 0xff, 0xff, 0xff, 0xff,
0xfe, 0xfe, 0xfe, 0xe6, 0x66, 0x66, 0x7e, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const char PROGMEM js[] = {
0x00, 0x00, 0x00, 0x80, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, 0xf8, 0x78, 0x7c, 0x3c, 0x1e, 0x9f,
0x9e, 0x1e, 0x3c, 0x3c, 0x78, 0xf8, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x03, 0x01, 0xf1, 0xf8, 0xfc, 0xfc, 0x06, 0x06, 0xff, 0x0f,
0x0f, 0x67, 0x67, 0xe6, 0xcc, 0x8c, 0xf8, 0xf9, 0x01, 0x03, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x80, 0x1f, 0x3f, 0x3f, 0x3f, 0x00, 0x80, 0xff, 0xe3,
0xe2, 0xce, 0xce, 0x4c, 0x64, 0x20, 0x11, 0x9f, 0x80, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x1f, 0x1f, 0x3c, 0x3c, 0x78, 0x79,
0xf9, 0x78, 0x3c, 0x3c, 0x1e, 0x1f, 0x0f, 0x07, 0x07, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00,
};
static const char PROGMEM qmk[] = {
0x00, 0x00, 0x00, 0x00, 0xe0, 0xf0, 0xf0, 0xf0, 0xf8, 0xf0, 0xf0, 0xf8, 0xf8, 0xf0, 0xf0, 0xf8,
0xf8, 0xf0, 0xf0, 0xf8, 0xf8, 0xf0, 0xf0, 0xf8, 0xf0, 0xf0, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x99, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x99, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x99, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf8, 0xf1, 0xf3, 0xe3, 0xe7, 0x00,
0x00, 0xe7, 0xe3, 0xf3, 0xf1, 0xf8, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x99, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x07, 0x0f, 0x0f, 0x0f, 0x1f, 0x0f, 0x0f, 0x1f, 0x1f, 0x0f, 0x0f, 0x1f,
0x1f, 0x0f, 0x0f, 0x1f, 0x1f, 0x0f, 0x0f, 0x1f, 0x0f, 0x0f, 0x0f, 0x07, 0x00, 0x00, 0x00, 0x00,
};
static const char PROGMEM brew[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xe7, 0xff, 0xfe, 0xfc, 0xf8, 0xfe,
0xe4, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xe7, 0x43, 0x41, 0x41, 0x4b, 0xcf, 0x87, 0x87, 0x8f,
0x87, 0x03, 0x03, 0xc3, 0x47, 0xe7, 0xa4, 0xb8, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x02, 0x02, 0x03, 0x00, 0xfe, 0x02, 0x02, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x40, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0xc0, 0x40, 0x7b, 0x0a, 0x0a, 0x0b, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

View file

@ -0,0 +1,22 @@
![Flare576 Keycaps](https://raw.githubusercontent.com/Flare576/sofle/main/images/keycaps.png)
![Flare576 Chord Guide](https://raw.githubusercontent.com/Flare576/sofle/main/images/chords.png)
# Flare576's keymap for Sofle Keyboard
[Layout](http://www.keyboard-layout-editor.com/#/gists/fb8b42a6156458e20ca421a6f80cec48) and [Chord Mapping](http://www.keyboard-layout-editor.com/#/gists/884e3bc833cdf80fed9337ffee93a500) in Keyboard Layout Manager
Features:
- WASD -> ESDF Gaming layer
- Mouse/Arrow Keys Layer with **amazing** rates
- Tap/Hold keys for `=/+`/`SHIFT`, `TAB`/`ALT`
- Bracket layer with Fn Keys
- Right-hand primary OLED
* Mode logo
* Mode title
* Luna WPM indicator
- Left-hand secondary OLED scrolling logo marquee
- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN/Home.
See [My Sofle Project](https://github.com/flare576/sofle) for more details

View file

@ -0,0 +1,7 @@
MOUSEKEY_ENABLE = yes
ENCODER_ENABLE = yes
EXTRAKEY_ENABLE = yes
TAP_DANCE_ENABLE = yes
WPM_ENABLE = yes
OLED_DRIVER_ENABLE = yes
SRC += graphics.c