-
-
Notifications
You must be signed in to change notification settings - Fork 39.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add elephant42 keyboard #14336
Add elephant42 keyboard #14336
Conversation
2a4b389
to
6a053b7
Compare
f8ef464
to
6a053b7
Compare
Thank you for a review! Addressed the comments |
Ping? 🥺👉 👈 |
No worries about the ping, it's been a ... .while, so it's absolutely understandable. However ... |
return true; | ||
} | ||
|
||
void oled_task_user(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, I'd like this in the keyboard's c file, that way there is an actual default, and if users don't specify one, it will still work just fine. This is especially useful for the QMK Configurator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, but there is a different number of layers in default and VIA keymaps 🤔
I guess I can add an "empty" layer to default keymap, or would it be all right to leave as it is now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, any oled_task_user()
functions need to be bool
signature (bool oled_task_user(void)
) and return false;
before existing.
Thank you for your contribution! |
a42dbf9
to
1dccb41
Compare
@drashna @noroadsleft Thank you for reviews! Addressed the comments |
LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW | ||
} | ||
}; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif | |
#endif | |
#ifdef OLED_ENABLE | |
# define STEPS 32 | |
uint8_t keypresses = 0; | |
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |
if (record->event.pressed) { | |
keypresses = (keypresses + 1) % STEPS; | |
} | |
return process_record_user(keycode, record); | |
} | |
bool oled_task_kb(void) { | |
if (!oled_task_user()) { | |
return false; | |
} | |
if (is_keyboard_master()) { | |
static char layer_names[NUMBER_OF_LAYERS][10] = {"Default", "Lower", "Raise", "Adjust"}; | |
static char l1[] = " \x94\x95\x96\x97"; | |
static char l2[] = " \xB4\xB5\xB6\xB7"; | |
static char r1[] = " \x98\x99\x9A\x9B"; | |
static char r2[] = " \xB8\xB9\xBA\xBB"; | |
int iconShift = keypresses % STEPS; | |
if (iconShift > STEPS / 2) { | |
iconShift = STEPS - iconShift; | |
} | |
bool goingLeft = keypresses < STEPS / 2; | |
oled_write_P(PSTR("Layer: "), false); | |
oled_write_ln(layer_names[get_highest_layer(layer_state)], false); | |
oled_advance_page(true); | |
oled_write_ln((goingLeft ? l1 : r1) + iconShift, false); | |
oled_write_ln((goingLeft ? l2 : r2) + iconShift, false); | |
} else { | |
oled_advance_page(true); | |
static const char PROGMEM logo[] = { | |
0x8f,0x90,0x91,0x92,0x93,0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x0a, | |
0xaf,0xb0,0xb1,0xb2,0xb3,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0x0a, | |
0xcf,0xd0,0xd1,0xd2,0xd3,0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0 | |
}; | |
oled_write_ln_P(logo, false); | |
} | |
return true; | |
} | |
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm, sorry, not sure what would a proper way to define it :(
I mean there is a reference to NUMBER_OF_LAYERS
(oled_task_kb
depends on the number of layers) and different keymaps can have different number of layers 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, might be worth just using 4 for that. the default keymap uses 3, and the via keymap uses 4. So just setting them may be fine. And if a user needs to change them, it can be done simply enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thank you for your contribution! |
This PR adds the elephant42 keyboard
Description
This is a split keyboard with 3x5+2 vertically staggered keys and 4 thumb keys.
/cc @illness072. Btw would be great if you could check the keymap please, I took it from the fork, but perhaps something needs to be changed.
Types of Changes
Checklist