mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-05-22 07:15:29 -04:00
OLED updates
- tweaked 32x128 master side. Got the layout and symbols I wanted - trying to track the ploopy nano drag scroll so the OLED will work - added Luna pet skeleton to slave side. need to tweak it.
This commit is contained in:
parent
7013d39810
commit
b3d323769a
7 changed files with 331 additions and 76 deletions
|
@ -20,10 +20,13 @@
|
||||||
#undef SPLIT_OLED_ENABLE
|
#undef SPLIT_OLED_ENABLE
|
||||||
#undef SPLIT_ACTIVITY_ENABLE
|
#undef SPLIT_ACTIVITY_ENABLE
|
||||||
#undef SPLIT_USB_DETECT
|
#undef SPLIT_USB_DETECT
|
||||||
|
#undef SPLIT_WPM_ENABLE
|
||||||
|
|
||||||
//Set common configuration for all keyboards
|
//Set common configuration for all keyboards
|
||||||
#define SPLIT_TRANSPORT_MIRROR
|
#define SPLIT_TRANSPORT_MIRROR
|
||||||
#define SPLIT_OLED_ENABLE
|
#define SPLIT_OLED_ENABLE
|
||||||
#define SPLIT_ACTIVITY_ENABLE
|
#define SPLIT_ACTIVITY_ENABLE
|
||||||
|
#define SPLIT_WPM_ENABLE
|
||||||
|
|
||||||
|
|
||||||
#define MASTER_RIGHT
|
#define MASTER_RIGHT
|
|
@ -1,4 +1,162 @@
|
||||||
#include "oled.h"
|
#include "oled.h"
|
||||||
|
|
||||||
|
/* KEYBOARD PET START */
|
||||||
|
|
||||||
|
/* settings */
|
||||||
|
# define MIN_WALK_SPEED 10
|
||||||
|
# define MIN_RUN_SPEED 40
|
||||||
|
|
||||||
|
/* advanced settings */
|
||||||
|
# define ANIM_FRAME_DURATION 200 // how long each frame lasts in ms
|
||||||
|
# define ANIM_SIZE 96 // number of bytes in array. If you change sprites, minimize for adequate firmware size. max is 1024
|
||||||
|
|
||||||
|
/* timers */
|
||||||
|
uint32_t anim_timer = 0;
|
||||||
|
|
||||||
|
/* current frame */
|
||||||
|
uint8_t current_frame = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
bool isSneaking = false;
|
||||||
|
bool isJumping = false;
|
||||||
|
bool showedJump = true;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* logic */
|
||||||
|
static void render_luna(int LUNA_X, int LUNA_Y) {
|
||||||
|
/* Sit */
|
||||||
|
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}};
|
||||||
|
|
||||||
|
/* Walk */
|
||||||
|
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,
|
||||||
|
}};
|
||||||
|
|
||||||
|
/* Run */
|
||||||
|
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,
|
||||||
|
}};
|
||||||
|
|
||||||
|
/* Bark */
|
||||||
|
static const char PROGMEM bark[2][ANIM_SIZE] = {/* 'bark1', 32x22px */
|
||||||
|
{
|
||||||
|
0x00, 0xc0, 0x20, 0x10, 0xd0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x3c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 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, 0x80, 0xc8, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
},
|
||||||
|
|
||||||
|
/* 'bark2', 32x22px */
|
||||||
|
{
|
||||||
|
0x00, 0xe0, 0x10, 0x10, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x2c, 0x14, 0x04, 0x08, 0x90, 0x18, 0x04, 0x08, 0xb0, 0x40, 0x80, 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, 0x80, 0xc0, 0x48, 0x28, 0x2a, 0x10, 0x0f, 0x20, 0x4a, 0x09, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x0c, 0x10, 0x20, 0x28, 0x37, 0x02, 0x02, 0x04, 0x08, 0x10, 0x26, 0x2b, 0x32, 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
}};
|
||||||
|
|
||||||
|
/* Sneak */
|
||||||
|
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 */
|
||||||
|
void animate_luna(void) {
|
||||||
|
/* jump */
|
||||||
|
if (isLunaJumping() || !isLunaShowedJump()) {
|
||||||
|
/* clear */
|
||||||
|
oled_set_cursor(LUNA_X, LUNA_Y + 2);
|
||||||
|
oled_write(" ", false);
|
||||||
|
|
||||||
|
oled_set_cursor(LUNA_X, LUNA_Y - 1);
|
||||||
|
|
||||||
|
setLunaShowedJump(true);
|
||||||
|
} else {
|
||||||
|
/* clear */
|
||||||
|
oled_set_cursor(LUNA_X, LUNA_Y - 1);
|
||||||
|
oled_write(" ", false);
|
||||||
|
|
||||||
|
oled_set_cursor(LUNA_X, LUNA_Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* switch frame */
|
||||||
|
current_frame = (current_frame + 1) % 2;
|
||||||
|
|
||||||
|
/* current status */
|
||||||
|
if (host_keyboard_led_state().caps_lock || is_caps_word_on()) {
|
||||||
|
oled_write_raw_P(bark[current_frame], ANIM_SIZE);
|
||||||
|
|
||||||
|
} else if (isLunaSneaking()) {
|
||||||
|
oled_write_raw_P(sneak[current_frame], ANIM_SIZE);
|
||||||
|
|
||||||
|
} else if (get_current_wpm() <= MIN_WALK_SPEED) {
|
||||||
|
oled_write_raw_P(sit[current_frame], ANIM_SIZE);
|
||||||
|
|
||||||
|
} else if (get_current_wpm() <= MIN_RUN_SPEED) {
|
||||||
|
oled_write_raw_P(walk[current_frame], ANIM_SIZE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
oled_write_raw_P(run[current_frame], ANIM_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# if OLED_TIMEOUT > 0
|
||||||
|
/* the animation prevents the normal timeout from occuring */
|
||||||
|
if (last_input_activity_elapsed() > OLED_TIMEOUT && last_led_activity_elapsed() > OLED_TIMEOUT) {
|
||||||
|
oled_off();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
oled_on();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
/* animation timer */
|
||||||
|
if (timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
|
||||||
|
anim_timer = timer_read32();
|
||||||
|
animate_luna();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* KEYBOARD PET END */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void render_crkbd_logo(void) {
|
void render_crkbd_logo(void) {
|
||||||
|
|
||||||
|
@ -108,6 +266,8 @@ void render_mod_status(void) {
|
||||||
oled_write_P(ctrl_off, false );
|
oled_write_P(ctrl_off, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oled_write_P(PSTR(" "), false);
|
||||||
|
|
||||||
if( (current_mod | current_osm) & MOD_MASK_ALT ) {
|
if( (current_mod | current_osm) & MOD_MASK_ALT ) {
|
||||||
oled_write_P(alt_on, false );
|
oled_write_P(alt_on, false );
|
||||||
}else {
|
}else {
|
||||||
|
@ -125,6 +285,7 @@ void render_mod_status(void) {
|
||||||
void render_feature_status(void) {
|
void render_feature_status(void) {
|
||||||
|
|
||||||
oled_write_ln_P(PSTR(OLED_RENDER_FEATURE_NAME), false);
|
oled_write_ln_P(PSTR(OLED_RENDER_FEATURE_NAME), false);
|
||||||
|
oled_write_P(PSTR(" "), false);
|
||||||
|
|
||||||
#if defined(RGB_MATRIX_ENABLE)
|
#if defined(RGB_MATRIX_ENABLE)
|
||||||
if (rgb_matrix_is_enabled()) {
|
if (rgb_matrix_is_enabled()) {
|
||||||
|
@ -136,6 +297,12 @@ oled_write_ln_P(PSTR(OLED_RENDER_FEATURE_NAME), false);
|
||||||
oled_write_P(rgb_off, false);
|
oled_write_P(rgb_off, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if(drag_scroll_is_enabled()) {
|
||||||
|
oled_write_P(dragscr_on, false);
|
||||||
|
} else {
|
||||||
|
oled_write_P(dragscr_off, false);
|
||||||
|
}
|
||||||
|
|
||||||
oled_write_P(PSTR(" "), false);
|
oled_write_P(PSTR(" "), false);
|
||||||
|
|
||||||
#if defined(AUDIO_ENABLE)
|
#if defined(AUDIO_ENABLE)
|
||||||
|
@ -191,7 +358,14 @@ bool oled_task_user(void) {
|
||||||
#elif defined(KEYBOARD_crkbd)
|
#elif defined(KEYBOARD_crkbd)
|
||||||
render_crkbd_logo();
|
render_crkbd_logo();
|
||||||
#else
|
#else
|
||||||
render_qmk_logo();
|
//render_qmk_logo();
|
||||||
|
|
||||||
|
/* KEYBOARD PET RENDER START */
|
||||||
|
|
||||||
|
render_luna(0, 13);
|
||||||
|
|
||||||
|
/* KEYBOARD PET RENDER END */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -210,6 +384,6 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return OLED_ROTATION_0;
|
return OLED_ROTATION_270;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,28 +32,31 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation);
|
||||||
static const char PROGMEM sep_v32[] = {0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0};
|
static const char PROGMEM sep_v32[] = {0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0};
|
||||||
|
|
||||||
static const char PROGMEM num_on[] = {0x91, 0};
|
static const char PROGMEM num_on[] = {0x91, 0};
|
||||||
static const char PROGMEM num_off[] = {0xDC, 0};
|
static const char PROGMEM num_off[] = {0xAD, 0};
|
||||||
|
|
||||||
static const char PROGMEM caps_on[] = {0x93, 0};
|
static const char PROGMEM caps_on[] = {0x93, 0};
|
||||||
static const char PROGMEM caps_off[] = {0xD9, 0};
|
static const char PROGMEM caps_off[] = {0xCD, 0};
|
||||||
|
|
||||||
static const char PROGMEM scroll_on[] = {0x8F, 0};
|
static const char PROGMEM scroll_on[] = {0x8F, 0};
|
||||||
static const char PROGMEM scroll_off[] = {0xD8, 0};
|
static const char PROGMEM scroll_off[] = {0x8D, 0};
|
||||||
|
|
||||||
static const char PROGMEM shift_on[] = {0x8F, 0};
|
static const char PROGMEM shift_on[] = {0x87, 0x88, 0};
|
||||||
static const char PROGMEM shift_off[] = {0xD8, 0};
|
static const char PROGMEM shift_off[] = {0x85, 0x86, 0};
|
||||||
|
|
||||||
static const char PROGMEM ctrl_on[] = {0x93, 0};
|
static const char PROGMEM ctrl_on[] = {0xAB, 0xAC, 0};
|
||||||
static const char PROGMEM ctrl_off[] = {0xD9, 0};
|
static const char PROGMEM ctrl_off[] = {0xA9, 0xAA, 0};
|
||||||
|
|
||||||
static const char PROGMEM alt_on[] = {0xD6, 0};
|
static const char PROGMEM alt_on[] = {0xA7, 0xA8, 0};
|
||||||
static const char PROGMEM alt_off[] = {0xDA, 0};
|
static const char PROGMEM alt_off[] = {0xA5, 0xA6, 0};
|
||||||
|
|
||||||
static const char PROGMEM gui_on[] = {0xD7, 0};
|
static const char PROGMEM gui_on[] = {0x8B, 0x8C, 0};
|
||||||
static const char PROGMEM gui_off[] = {0xDB, 0};
|
static const char PROGMEM gui_off[] = {0x89, 0x8A, 0};
|
||||||
|
|
||||||
static const char PROGMEM rgb_on[] = {0xD4, 0xD5, 0};
|
static const char PROGMEM rgb_on[] = {0xC7, 0xC8, 0};
|
||||||
static const char PROGMEM rgb_off[] = {0xDD, 0xDE, 0};-
|
static const char PROGMEM rgb_off[] = {0xC5, 0xC6, 0};
|
||||||
|
|
||||||
|
static const char PROGMEM dragscr_on[] = {0xBD, 0xBE, 0};
|
||||||
|
static const char PROGMEM dragscr_off[] = {0x9D, 0x9E, 0};
|
||||||
|
|
||||||
static const char PROGMEM audio_on[] = {0xAF, 0xB0, 0};
|
static const char PROGMEM audio_on[] = {0xAF, 0xB0, 0};
|
||||||
static const char PROGMEM audio_off[] = {0xCF, 0xD0, 0};
|
static const char PROGMEM audio_off[] = {0xCF, 0xD0, 0};
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// This is the KLOR font file modified
|
|
||||||
// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
|
// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
|
||||||
// See gfxfont.h for newer custom bitmap font info.
|
// See gfxfont.h for newer custom bitmap font info.
|
||||||
|
|
||||||
|
@ -140,16 +139,16 @@ static const unsigned char PROGMEM font[] = {
|
||||||
0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F,
|
0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F,
|
||||||
0x0F, 0x0F, 0x9F, 0xFF, 0xFE, 0xF0,
|
0x0F, 0x0F, 0x9F, 0xFF, 0xFE, 0xF0,
|
||||||
0xF0, 0xF0, 0xF0, 0xE0, 0x00, 0x00,
|
0xF0, 0xF0, 0xF0, 0xE0, 0x00, 0x00,
|
||||||
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x08, 0x0C, 0x7E, 0x7F,
|
||||||
0x00, 0xC0, 0x30, 0x0C, 0x03, 0x00,
|
0x7E, 0x0C, 0x08, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x00, 0x00,
|
0x7F, 0x7F, 0x77, 0x73, 0x01, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x01, 0x73, 0x77, 0x7F, 0x7F, 0x00,
|
||||||
0xE0, 0x10, 0x08, 0x04, 0x02, 0x02,
|
0x00, 0x00, 0x77, 0x77, 0x77, 0x00,
|
||||||
0x02, 0x01, 0x01, 0x01, 0x01, 0x01,
|
0x77, 0x77, 0x77, 0x00, 0x00, 0x00,
|
||||||
0x01, 0x02, 0x02, 0x02, 0x04, 0x08,
|
0x7F, 0x7F, 0x08, 0x08, 0x08, 0x7F,
|
||||||
0x10, 0xE0, 0x00, 0x00, 0x00, 0x00,
|
0x08, 0x08, 0x08, 0x7F, 0x7F, 0x00,
|
||||||
0xFF, 0x01, 0x01, 0x01, 0x01, 0x01,
|
0x00, 0x2E, 0x2A, 0x2A, 0x3A, 0x00,
|
||||||
0x01, 0x01, 0x01, 0x01, 0x01, 0xFF,
|
0x3E, 0x20, 0x20, 0x20, 0x00, 0x00,
|
||||||
0x7F, 0x51, 0x55, 0x55, 0x45, 0x7F,
|
0x7F, 0x51, 0x55, 0x55, 0x45, 0x7F,
|
||||||
0x41, 0x5F, 0x5F, 0x5F, 0x7F, 0x00,
|
0x41, 0x5F, 0x5F, 0x5F, 0x7F, 0x00,
|
||||||
0x7F, 0x41, 0x7B, 0x77, 0x41, 0x7F,
|
0x7F, 0x41, 0x7B, 0x77, 0x41, 0x7F,
|
||||||
|
@ -164,30 +163,30 @@ static const unsigned char PROGMEM font[] = {
|
||||||
0xFF, 0x1F, 0xDE, 0x1C, 0xF8, 0x00,
|
0xFF, 0x1F, 0xDE, 0x1C, 0xF8, 0x00,
|
||||||
0xC0, 0xE2, 0xB4, 0xF8, 0xF8, 0xF8,
|
0xC0, 0xE2, 0xB4, 0xF8, 0xF8, 0xF8,
|
||||||
0xF8, 0xF8, 0xB4, 0xE2, 0xC0, 0x00,
|
0xF8, 0xF8, 0xB4, 0xE2, 0xC0, 0x00,
|
||||||
0x7F, 0x7F, 0x7F, 0x6B, 0x49, 0x08,
|
0x7F, 0x01, 0x01, 0x01, 0x01, 0x3F,
|
||||||
0x49, 0x6B, 0x7F, 0x7F, 0x7F, 0x00,
|
0x01, 0x01, 0x01, 0x01, 0x7F, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x07, 0x0F, 0x0F, 0x0F,
|
0x00, 0x00, 0x07, 0x0F, 0x0F, 0x0F,
|
||||||
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F,
|
0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F,
|
||||||
0x87, 0xE1, 0xF9, 0xF9, 0xE1, 0x87,
|
0x87, 0xE1, 0xF9, 0xF9, 0xE1, 0x87,
|
||||||
0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
|
0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
|
||||||
0x0F, 0x0F, 0x0F, 0x07, 0x00, 0x00,
|
0x0F, 0x0F, 0x0F, 0x07, 0x00, 0x00,
|
||||||
0xFF, 0x00, 0x00, 0xC0, 0x30, 0x0C,
|
0x00, 0x06, 0x06, 0x06, 0x0C, 0x18,
|
||||||
0x33, 0xC0, 0x00, 0x00, 0x00, 0x00,
|
0x30, 0x66, 0x66, 0x66, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x00, 0x00,
|
0x7F, 0x79, 0x79, 0x79, 0x73, 0x67,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x3F,
|
0x4F, 0x19, 0x19, 0x19, 0x7F, 0x00,
|
||||||
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x60, 0x70, 0x38, 0x1C, 0x0E,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x1C, 0x38, 0x70, 0x60, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x7F, 0x1F, 0x0F, 0x47, 0x63, 0x71,
|
||||||
0x00, 0xC0, 0x3F, 0x00, 0x00, 0x00,
|
0x63, 0x47, 0x0F, 0x1F, 0x7F, 0x00,
|
||||||
0xFF, 0x08, 0x08, 0x08, 0x08, 0x08,
|
0x00, 0x3E, 0x04, 0x08, 0x3E, 0x00,
|
||||||
0x08, 0x38, 0xC8, 0x08, 0x08, 0x0F,
|
0x3E, 0x20, 0x20, 0x20, 0x00, 0x00,
|
||||||
0x7F, 0x43, 0x7F, 0x41, 0x7F, 0x47,
|
0x7F, 0x43, 0x7F, 0x41, 0x7F, 0x47,
|
||||||
0x7F, 0x43, 0x7F, 0x47, 0x7F, 0x00,
|
0x7F, 0x43, 0x7F, 0x4F, 0x7F, 0x00,
|
||||||
0x7F, 0x5B, 0x5B, 0x6D, 0x6D, 0x5B,
|
0x7F, 0x5B, 0x5B, 0x6D, 0x6D, 0x5B,
|
||||||
0x5B, 0x6D, 0x6D, 0x5B, 0x7F, 0x00,
|
0x5B, 0x6D, 0x6D, 0x5B, 0x7F, 0x00,
|
||||||
0x00, 0x24, 0x24, 0x24, 0x24, 0x24,
|
0x00, 0x24, 0x24, 0x12, 0x12, 0x24,
|
||||||
0x24, 0x24, 0x24, 0x24, 0x00, 0x00,
|
0x24, 0x12, 0x12, 0x24, 0x00, 0x00,
|
||||||
0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x3F,
|
0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x3F,
|
||||||
0x3F, 0x7F, 0x7F, 0x38, 0x10, 0x00,
|
0x3F, 0x7F, 0x7F, 0x38, 0x10, 0x00,
|
||||||
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00,
|
0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00,
|
||||||
|
@ -196,39 +195,39 @@ static const unsigned char PROGMEM font[] = {
|
||||||
0x45, 0x40, 0x21, 0x14, 0x0F, 0x00,
|
0x45, 0x40, 0x21, 0x14, 0x0F, 0x00,
|
||||||
0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D,
|
0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D,
|
||||||
0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x00,
|
0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x14, 0x36, 0x77,
|
0x7F, 0x7F, 0x7F, 0x7F, 0x01, 0x3D,
|
||||||
0x36, 0x14, 0x00, 0x00, 0x00, 0x00,
|
0x01, 0x7F, 0x7F, 0x7F, 0x7F, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x3F, 0x0C, 0x03, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x1C, 0x62, 0x0A,
|
||||||
0x00, 0x00, 0x03, 0x0C, 0x30, 0x00,
|
0x62, 0x1C, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x3F, 0x20, 0x20,
|
0x7F, 0x57, 0x7D, 0x67, 0x02, 0x1B,
|
||||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
0x02, 0x67, 0x7D, 0x57, 0x7F, 0x00,
|
||||||
0x01, 0x02, 0x04, 0x08, 0x10, 0x10,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x10, 0x20, 0x20, 0x20, 0x20, 0x20,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x20, 0x10, 0x10, 0x10, 0x08, 0x04,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x02, 0x01, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x3E, 0x22, 0x22, 0x22, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x03, 0x0C, 0x30,
|
0x3E, 0x20, 0x20, 0x20, 0x00, 0x00,
|
||||||
0x00, 0x30, 0x00, 0x30, 0x00, 0x30,
|
0x00, 0x3C, 0x00, 0x3E, 0x00, 0x38,
|
||||||
0x00, 0x30, 0x00, 0x30, 0x00, 0x00,
|
0x00, 0x3C, 0x00, 0x30, 0x00, 0x00,
|
||||||
0x1C, 0x3E, 0x3E, 0x3E, 0x1C, 0x00,
|
0x1C, 0x3E, 0x3E, 0x3E, 0x1C, 0x00,
|
||||||
0x3E, 0x1C, 0x1C, 0x08, 0x08, 0x00,
|
0x3E, 0x1C, 0x1C, 0x08, 0x08, 0x00,
|
||||||
0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x00,
|
0x3E, 0x3E, 0x3E, 0x3E, 0x3E, 0x00,
|
||||||
0x7F, 0x41, 0x5F, 0x7F, 0x41, 0x55,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x7F, 0x41, 0x5D, 0x63, 0x7F, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x7F, 0x43, 0x75, 0x75, 0x43, 0x7F,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x7F, 0x41, 0x5D, 0x55, 0x45, 0x7F,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x2E, 0x2A, 0x2A, 0x3A, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x3E, 0x22, 0x22, 0x22, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x3C, 0x0A, 0x0A, 0x3C, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x3E, 0x22, 0x2A, 0x3A, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x3E, 0x04, 0x08, 0x3E, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x3E, 0x20, 0x00, 0x3E, 0x2A,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x22, 0x00, 0x3E, 0x22, 0x1C, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,6 +35,7 @@ MOUSEKEY_ENABLE = yes
|
||||||
COMBO_ENABLE = yes
|
COMBO_ENABLE = yes
|
||||||
KEY_OVERRIDE_ENABLE = yes
|
KEY_OVERRIDE_ENABLE = yes
|
||||||
MUSIC_MODE = no
|
MUSIC_MODE = no
|
||||||
|
WPM_ENABLE = yes
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# include my code that will be common across all my keyboards
|
# include my code that will be common across all my keyboards
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
#include "t4corun.h"
|
#include "t4corun.h"
|
||||||
|
|
||||||
static uint8_t current_base_layer = _DEFAULT_LAYER_1;
|
static uint8_t current_base_layer = _DEFAULT_LAYER_1;
|
||||||
|
static bool drag_scroll_enabled = false;
|
||||||
|
|
||||||
|
|
||||||
|
/* Luna variables */
|
||||||
|
static bool isSneaking = false;
|
||||||
|
static bool isJumping = false;
|
||||||
|
static bool showedJump = true;
|
||||||
|
|
||||||
|
|
||||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
|
||||||
|
@ -8,10 +16,67 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool drag_scroll_is_enabled(void) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
Keeps track of Ploopy Nano drag scroll from the keyboard side
|
||||||
|
It doesn't actually talk to the Ploopy Nano so there is a chance
|
||||||
|
This may be out of sync
|
||||||
|
|
||||||
|
Used to enable OLED indicator
|
||||||
|
*/
|
||||||
|
return drag_scroll_enabled;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isLunaSneaking(void) {
|
||||||
|
|
||||||
|
return isSneaking;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isLunaJumping(void) {
|
||||||
|
|
||||||
|
return isJumping;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isLunaShowedJump(void) {
|
||||||
|
|
||||||
|
return showedJump;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setLunaShowedJump(bool state) {
|
||||||
|
|
||||||
|
showedJump = state;
|
||||||
|
}
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
|
|
||||||
|
/* KEYBOARD PET STATUS START */
|
||||||
|
|
||||||
|
case TR_LCTL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
isSneaking = true;
|
||||||
|
} else {
|
||||||
|
isSneaking = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case KC_SPC:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
isJumping = true;
|
||||||
|
showedJump = false;
|
||||||
|
} else {
|
||||||
|
isJumping = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* KEYBOARD PET STATUS END */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case BASELYR:
|
case BASELYR:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
|
|
||||||
|
@ -39,6 +104,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
// double_tap(KC_NUM, KC_NUM, WAIT_DELAY);
|
// double_tap(KC_NUM, KC_NUM, WAIT_DELAY);
|
||||||
double_tap(KC_NUM, WAIT_DELAY);
|
double_tap(KC_NUM, WAIT_DELAY);
|
||||||
|
|
||||||
|
//I realize this may not work for the Charybdis nano
|
||||||
|
drag_scroll_enabled = !drag_scroll_enabled;
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,13 @@
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
#include "features/taphold.h"
|
#include "features/taphold.h"
|
||||||
|
|
||||||
|
bool drag_scroll_is_enabled(void);
|
||||||
|
|
||||||
|
bool isLunaSneaking(void);
|
||||||
|
bool isLunaJumping(void);
|
||||||
|
bool isLunaShowedJump(void);
|
||||||
|
|
||||||
|
void setLunaShowedJump(bool state);
|
||||||
|
|
||||||
enum layers {
|
enum layers {
|
||||||
_QWERTY = 0,
|
_QWERTY = 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue