1
0
Fork 0

[Keymap+] SnailMap port for the Kintsugi keyboard. (#17341)

This commit is contained in:
Arturo Avila 2022-06-14 19:13:37 -05:00 committed by GitHub
parent b7ce3b1967
commit de207b97fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 563 additions and 235 deletions

View file

@ -21,39 +21,36 @@
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) {
return false;
}
} else {
/* The switch case allows for different encoder mappings on different layers, "default" map gets applied for all unspecified layers */
switch(get_highest_layer(layer_state)){
case 1:
if (clockwise) {
tap_code(KC_MNXT);
} else {
tap_code(KC_MPRV);
}
break;
default:
if (clockwise){
tap_code(KC_VOLU);
} else{
tap_code(KC_VOLD);
}
break;
switch(get_highest_layer(layer_state)){
case 1:
if (clockwise) {
tap_code(KC_MNXT);
} else {
tap_code(KC_MPRV);
}
break;
default:
if (clockwise){
tap_code(KC_VOLU);
} else{
tap_code(KC_VOLD);
}
break;
}
}
return true;
}
#endif
/* Rotation of the OLED: */
#ifdef OLED_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
return OLED_ROTATION_270;
}
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
/* Kintsugi logo render: */
static void render_logo(void) {
/* Kintsugi logo render: */
static const char PROGMEM logo_1[] = {
0x83, 0x84, 0x85, 0x86, 0x87, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0x00
};
@ -63,12 +60,22 @@ bool oled_task_kb(void) {
static const char PROGMEM logo_3[] = {
0x8D, 0x8E, 0x8F, 0x90, 0x91, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0x00
};
oled_set_cursor(1,3);
oled_set_cursor(0,3);
oled_write_P(logo_1, false);
oled_set_cursor(1,7);
oled_set_cursor(0,7);
oled_write_P(logo_2, false);
oled_set_cursor(1,11);
oled_set_cursor(0,11);
oled_write_P(logo_3, false);
}
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
else {
render_logo();
}
return true;
}
#endif