sofle own keymap

This commit is contained in:
Kabbone 2023-10-23 15:34:25 +02:00
parent 0e6d47e1e4
commit 82b9c99b59
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
5 changed files with 537 additions and 0 deletions

View File

@ -0,0 +1 @@
qmk flash -kb sofle/keyhive -km Kabbone -bl avrdude-split-left

View File

@ -0,0 +1,43 @@
#pragma once
/* The way how "handedness" is decided (which half is which),
see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness
for more options.
*/
#ifdef ENCODER_ENABLE
// #define ENCODER_RESOLUTIONS { 4, 2 }
#endif
#ifdef TAPPING_TERM
#undef TAPPING_TERM
#define TAPPING_TERM 700
#endif
//#define TAPPING_FORCE_HOLD
//#define PERMISSIVE_HOLD
//#define RETRO_SHIFT 175
#define AUTO_SHIFT_TIMEOUT 250
//#define RETRO_TAPPING
#ifdef RGBLIGHT_ENABLE
#define RGBLIGHT_SLEEP //Turn off LEDs when computer sleeping (+72)
#define RGBLIGHT_LAYERS //Enable layer light indicators. Not required as updates are done in layer_state_set_user and led_update_user (+588).
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_STATIC_LIGHT
#define RGBLIGHT_DEFAULT_HUE 30
#define RGBLIGHT_DEFAULT_VAL 30
#define RGBLIGHT_STATIC_LIGHT
//#define RGBLIGHT_ANIMATIONS
//#define RGBLIGHT_EFFECT_BREATHING
//#define RGBLIGHT_EFFECT_RAINBOW_MOOD
//#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
//#define RGBLIGHT_EFFECT_SNAKE
//#define RGBLIGHT_EFFECT_KNIGHT
//#define RGBLIGHT_EFFECT_CHRISTMAS
//#define RGBLIGHT_EFFECT_STATIC_GRADIENT
//#define RGBLIGHT_EFFECT_RGB_TEST
//#define RGBLIGHT_EFFECT_ALTERNATING
//#define RGBLIGHT_EFFECT_TWINKLE
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
#endif

View File

@ -0,0 +1,462 @@
#include QMK_KEYBOARD_H
#define INDICATOR_BRIGHTNESS 30
enum sofle_layers {
_DEFAULTS = 0,
_COLEMAKDH = 0,
_QWERTY,
_SYM,
_NAV,
_ADJUST,
_NUMPAD,
_SWITCH
};
enum custom_keycodes {
KC_QWERTY = SAFE_RANGE,
KC_COLEMAKDH,
KC_SYM,
KC_NAV,
KC_ADJUST,
KC_D_MUTE
};
enum unicode_names {
DESSS,
DEBAE,
DESAE,
DEBOE,
DESOE,
DEBUE,
DESUE
};
const uint32_t PROGMEM unicode_map[] = {
[DESSS] = 0x00DF, // ß
[DEBAE] = 0x00C4, // Ä
[DESAE] = 0x00E4, // ä
[DEBOE] = 0x00D6, // Ö
[DESOE] = 0x00F6, // ö
[DEBUE] = 0x00DC, // Ü
[DESUE] = 0x00FC, // ü
};
#define UE UC(0x00DC)
// Left-hand home row mods
#define HOME_A LCTL_T(KC_A)
#define HOME_R LSFT_T(KC_R)
#define HOME_S LGUI_T(KC_S)
#define HOME_T LALT_T(KC_T)
// Right-hand home row mods
#define HOME_N LALT_T(KC_N)
#define HOME_E RGUI_T(KC_E)
#define HOME_I RSFT_T(KC_I)
#define HOME_O RCTL_T(KC_O)
#define RSA_GUI RSA_T(KC_LGUI)
#define UML_A ALGR(KC_Q)
#define UML_O ALGR(KC_P)
#define UML_U ALGR(KC_Y)
#define UML_SS ALGR(KC_S)
#define NAV_DEL LT(_NAV,KC_DEL)
#define SYM_ESC LT(_SYM,KC_ESC)
#define SWI_GUI LT(_SWITCH,KC_LGUI)
#define ADJ_GUI LT(_ADJUST,KC_LGUI)
bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case HOME_A:
return true;
case HOME_R:
return true;
case HOME_S:
return true;
case HOME_T:
return true;
case HOME_N:
return true;
case HOME_E:
return true;
case HOME_I:
return true;
case HOME_O:
return true;
default:
return false;
}
}
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* QWERTY
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ESC | Q | W | E | R | T | | Y | U | I | O | P | Bspc |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' |
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift|
* `-----------------------------------------/ / \ \-----------------------------------------'
* | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_QWERTY] = LAYOUT(
KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, LT(_SWITCH,KC_6), KC_7, KC_8, KC_9, KC_0, KC_GRV,
QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
DF(_COLEMAKDH), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, KC_D_MUTE,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
KC_LCTL,KC_LALT,MO(_SYM),KC_LSFT,KC_ENT, KC_BSPC,KC_SPC, NAV_DEL, KC_LBRC, KC_RBRC
),
/*
* COLEMAK
* ,-----------------------------------------. ,-----------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ESC | Q | W | F | P | B | | J | L | U | Y | ; | Bspc |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | TAB | A | R | S | T | G |-------. ,-------| M | N | E | I | O | ' |
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* |LShift| Z | X | C | D | V |-------| |-------| K | H | , | . | / |RShift|
* `-----------------------------------------/ / \ \-----------------------------------------'
* | LGUI | LAlt | LCTR |SHIFT | /Enter / \Bspace\ |SPACE | RCTR | RAlt | RGUI |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_COLEMAKDH] = LAYOUT(
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_ESC ,
QK_GESC, KC_Q , KC_W , KC_F , KC_P , KC_B, KC_J , KC_L , KC_U , KC_Y , KC_QUOT, KC_BSLS,
KC_TAB , HOME_A, HOME_R, HOME_S, HOME_T, KC_G, KC_M , HOME_N , HOME_E , HOME_I, HOME_O , KC_SCLN,
ADJ_GUI, KC_Z , KC_X , KC_C , KC_D , KC_V, KC_MUTE, KC_NO, KC_K , KC_H , KC_COMM, KC_DOT, KC_SLSH, KC_EQL,
KC_LCTL,KC_LALT,MO(_SYM),KC_LSFT,KC_ENT, KC_BSPC,KC_SPC, NAV_DEL, KC_LBRC, KC_RBRC
),
/* SYM
* ,-----------------------------------------. ,-----------------------------------------.
* | trans| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | trans| ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | | |
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* | trans| = | - | + | { | } |-------| |-------| [ | ] | ; | : | \ | Shift|
* `-----------------------------------------/ / \ \-----------------------------------------'
* | Bspc | WIN |SYM | Enter| /Space / \Enter \ |SPACE |NAV | RCTR | RAlt |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_SYM] = LAYOUT(
_______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_F12 ,
_______ , KC_DLR , KC_PLUS, KC_LPRN, KC_RPRN, KC_AT , KC_PIPE, KC_MINS, KC_EQL , KC_UNDS, KC_ASTR, KC_LT,
DF(_QWERTY), KC_EXLM, KC_HASH, KC_LCBR, KC_RCBR, KC_GRV, _______,_______, KC_AMPR, KC_LBRC, KC_RBRC, KC_PERC, KC_CIRC, KC_GT,
RGB_MODE_SWIRL, RGB_VAI, _______, RGB_VAD, RGB_TOG, KC_BSPC, KC_COLN, _______, _______, _______
),
/* NAV
* ,----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Esc | Ins | Pscr | Menu | | | | | PWrd | Up | NWrd | DLine| Bspc |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | LAt | LCtl |LShift| | Caps |-------. ,-------| | Left | Down | Rigth| Del | Bspc |
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* |Shift | Undo | Cut | Copy | Paste| |-------| |-------| | LStr | | LEnd | | Shift|
* `-----------------------------------------/ / \ \-----------------------------------------'
* | LGUI | LAlt | LCTR |SYM | /Enter / \Space \ |NAV | RCTR | RAlt | RGUI |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_NAV] = LAYOUT(
_______, _______, _______, _______, _______, _______, KC_MS_LEFT,KC_MS_DOWN,KC_MS_UP,KC_MS_RIGHT,KC_MS_BTN1,KC_MS_BTN2,
_______, XXXXXXX, KC_PSCR, KC_APP , XXXXXXX, XXXXXXX, KC_PGUP , KC_PASTE , KC_COPY, KC_CUT , KC_UNDO , KC_BSPC,
_______, KC_LCTL, KC_LSFT, KC_LGUI, KC_LALT, KC_CAPS, KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_DEL , KC_BSPC,
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_PGDN , KC_HOME , KC_END , KC_INS , _______ , _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* ADJUST
* ,-----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | QK_BOOT| | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* |RGB_TOG|hue^ |sat ^ | bri ^| |COLEMAK|-------. ,-------|desk <| | |desk >| | |
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* | mode | hue dn|sat d|bri dn| |QWERTY|-------| |-------| | PREV | PLAY | NEXT | | |
* `-----------------------------------------/ / \ \-----------------------------------------'
* | LGUI | LAlt | LCTR |SYM | /Enter / \Space \ |NAV | RCTR | RAlt | RGUI |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_ADJUST] = LAYOUT(
//,------------------------------------------------. ,---------------------------------------------------.
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, UML_U, XXXXXXX, XXXXXXX, XXXXXXX,
//|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------|
XXXXXXX, UML_A, XXXXXXX, UML_SS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, UML_O, XXXXXXX,
//|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
//|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------|
_______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______
// \--------+--------+--------+---------+-------| |--------+---------+--------+---------+-------/
),
/* NUMPAD
* ,-----------------------------------------. ,-----------------------------------------.
* | trans| | | | | | | |NumLck| | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | ` | | | | | | | ^ | 7 | 8 | 9 | * | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | trans| | | | | |-------. ,-------| - | 4 | 5 | 6 | | | |
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* | trans| | | | | |-------| |-------| + | 1 | 2 | 3 | \ | Shift|
* `-----------------------------------------/ / \ \-----------------------------------------'
* | Bspc | WIN |SYM | Enter| /Space / \Enter \ |SPACE | 0 | . | RAlt |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
[_NUMPAD] = LAYOUT(
//,------------------------------------------------. ,---------------------------------------------------.
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_NUM, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX,
//|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_CIRC, KC_P7, KC_P8, KC_P9, KC_ASTR, XXXXXXX,
//|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_P4, KC_P5, KC_P6, KC_EQL, KC_PIPE,
//|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,_______, _______,KC_PLUS, KC_P1, KC_P2, KC_P3, KC_SLSH, _______,
//|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------|
_______, OSM(MOD_MEH), _______, _______, _______, _______, _______, KC_P0, KC_PDOT, _______
// \--------+--------+--------+---------+-------| |--------+---------+--------+---------+-------/
),
/* SWITCH
* ,-----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | qwer | cole |col_dh| low | raise| adj | |numpad| | | | |QK_BOOT |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | | | | | | |-------. ,-------| | | | | |EEP_RST|
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* | SLEEP| | | | | |-------| |-------| | | | | | |
* `-----------------------------------------/ / \ \-----------------------------------------'
* | Bspc | WIN |SYM | Enter| /Space / \Enter \ |SPACE | 0 | . | RAlt |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
// layer switcher
[_SWITCH] = LAYOUT(
//,------------------------------------------------. ,---------------------------------------------------.
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, XXXXXXX,
//|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------|
TO(0), TO(1), TO(2), TO(3), TO(4), TO(5), TO(6), KC_NO, KC_NO, KC_NO, KC_NO, QK_BOOT,
//|------+-------+--------+--------+--------+------| |--------+-------+--------+--------+--------+---------|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, EE_CLR,
//|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------|
UE, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
//|------+-------+--------+--------+--------+------| === | | === |--------+-------+--------+--------+--------+---------|
KC_NO, KC_NO, KC_NO, KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
// \--------+--------+--------+---------+-------| |--------+---------+--------+---------+-------/
),
};
/* RAISE
* ,----------------------------------------. ,-----------------------------------------.
* | | | | | | | | | | | | | |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Esc | Ins | Pscr | Menu | | | | | PWrd | Up | NWrd | DLine| Bspc |
* |------+------+------+------+------+------| |------+------+------+------+------+------|
* | Tab | LAt | LCtl |LShift| | Caps |-------. ,-------| | Left | Down | Rigth| Del | Bspc |
* |------+------+------+------+------+------| MUTE | | |------+------+------+------+------+------|
* |Shift | Undo | Cut | Copy | Paste| |-------| |-------| | LStr | | LEnd | | Shift|
* `-----------------------------------------/ / \ \-----------------------------------------'
* | LGUI | LAlt | LCTR |LOWER | /Enter / \Space \ |RAISE | RCTR | RAlt | RGUI |
* | | | | |/ / \ \ | | | | |
* `----------------------------------' '------''---------------------------'
*/
#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_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,0
};
oled_write_P(qmk_logo, false);
}
static void print_status_narrow(void) {
// Print current mode
oled_write_P(PSTR("\n\n"), false);
switch (get_highest_layer(default_layer_state)) {
case _QWERTY:
oled_write_ln_P(PSTR("Qwrt"), false);
break;
case _COLEMAKDH:
oled_write_ln_P(PSTR("CmkDH"), false);
break;
default:
oled_write_P(PSTR("Undef"), false);
}
oled_write_P(PSTR("\n\n"), false);
// Print current layer
oled_write_ln_P(PSTR("LAYER"), false);
switch (get_highest_layer(layer_state)) {
case _QWERTY:
case _COLEMAKDH:
oled_write_P(PSTR("Base\n"), false);
break;
case _NAV:
oled_write_P(PSTR("NAV"), false);
break;
case _SYM:
oled_write_P(PSTR("SYM"), false);
break;
case _ADJUST:
oled_write_P(PSTR("Adj\n"), false);
case _NUMPAD:
oled_write_P(PSTR("Nump\n"), false);
break;
case _SWITCH:
oled_write_P(PSTR("Swit\n"), false);
break;
default:
oled_write_ln_P(PSTR("Undef"), false);
}
oled_write_P(PSTR("\n\n"), false);
led_t led_usb_state = host_keyboard_led_state();
oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
}
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master()) {
return OLED_ROTATION_270;
}
return rotation;
}
bool oled_task_user(void) {
if (is_keyboard_master()) {
print_status_narrow();
} else {
render_logo();
}
return false;
}
#endif
layer_state_t layer_state_set_user(layer_state_t state) {
return update_tri_layer_state(state, _SYM, _NAV, _ADJUST);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_QWERTY:
if (record->event.pressed) {
set_single_persistent_default_layer(_QWERTY);
}
return false;
case KC_COLEMAKDH:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAKDH);
}
return false;
case KC_SYM:
if (record->event.pressed) {
layer_on(_SYM);
update_tri_layer(_SYM, _NAV, _ADJUST);
} else {
layer_off(_SYM);
update_tri_layer(_SYM, _NAV, _ADJUST);
}
return false;
case KC_NAV:
if (record->event.pressed) {
layer_on(_NAV);
update_tri_layer(_SYM, _NAV, _ADJUST);
} else {
layer_off(_NAV);
update_tri_layer(_SYM, _NAV, _ADJUST);
}
return false;
case KC_ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
case KC_D_MUTE:
if (record->event.pressed) {
register_mods(mod_config(MOD_MEH));
register_code(KC_UP);
} else {
unregister_mods(mod_config(MOD_MEH));
unregister_code(KC_UP);
}
}
return true;
}
//#ifdef ENCODER_ENABLE
//
//bool encoder_update_user(uint8_t index, bool clockwise) {
// if (index == 0) {
// if (clockwise) {
// tap_code(KC_VOLU);
// } else {
// tap_code(KC_VOLD);
// }
// } else if (index == 1) {
// switch (get_highest_layer(layer_state)) {
// case _COLEMAKDH:
// if (clockwise) {
// tap_code(KC_PGDN);
// } else {
// tap_code(KC_PGUP);
// }
// //break;
// case _NAV:
// case _SYM:
// if (clockwise) {
// tap_code(KC_UP);
// } else {
// tap_code(KC_DOWN);
// }
// //break;
// case _QWERTY:
// default:
// if (clockwise) {
// tap_code(KC_PGDN);
// } else {
// tap_code(KC_PGUP);
// }
// //break;
// }
// }
// return true;
//}
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_QWERTY] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
[_COLEMAKDH] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN) },
[_NAV] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) },
[_SYM] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) },
[_ADJUST] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) },
[_NUMPAD] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) },
[_SWITCH] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) },
};
#endif
//#endif

View File

@ -0,0 +1,19 @@
![SofleKeyboard default keymap](https://github.com/josefadamcik/SofleKeyboard/raw/master/Images/soflekeyboard.png)
![SofleKeyboard adjust layer](https://github.com/josefadamcik/SofleKeyboard/raw/master/Images/soflekeyboard_layout_adjust.png)
# Default keymap for Sofle Keyboard
Layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/76efb423a46cbbea75465cb468eef7ff) and [adjust layer](http://www.keyboard-layout-editor.com/#/gists/4bcf66f922cfd54da20ba04905d56bd4)
Features:
- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift)
- Various modes, can be switched (using Adjust layer and the selected one is stored in EEPROM.
- Modes for Qwerty and Colemak support
- Modes for Mac vs Linux/Win support -> different order of modifiers and different action shortcuts on the "UPPER" layer (the red one in the image). Designed to simplify transtions when switching between operating systems often.
- The OLED on master half shows selected mode and caps lock state and is rotated.
- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN.

View File

@ -0,0 +1,12 @@
OLED_ENABLE = yes
ENCODER_ENABLE = yes
ENCODER_MAP_ENABLE = yes
CONSOLE_ENABLE = no
EXTRAKEY_ENABLE = yes
MOUSEKEY_ENABLE = no
RGBLIGHT_ENABLE = yes
NKRO_ENABLE = yes # Enable N-Key Rollover
DEBOUNCE_TYPE = sym_eager_pk # Debounce eagerly (report change immediately), keep per-key timers. We can use
# this because the sofle does not have to deal with noise.
AUTO_SHIFT_ENABLE = yes