diff options
author | takashicompany <t@kashi.company> | 2023-07-13 00:17:04 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 09:17:04 -0600 |
commit | c83ff03a401e5de29871be7eb177746674956b19 (patch) | |
tree | 0134bf6428db7a8e4808af5bbe024ae7d71b1546 /keyboards/takashicompany/minidivide/minidivide.c | |
parent | 83c81826e38c5483f5a471cfed5977be886ca62b (diff) |
[Keyboard] Add minidivide (#19870)
Co-authored-by: jack <0x6a73@protonmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/takashicompany/minidivide/minidivide.c')
-rw-r--r-- | keyboards/takashicompany/minidivide/minidivide.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/keyboards/takashicompany/minidivide/minidivide.c b/keyboards/takashicompany/minidivide/minidivide.c new file mode 100644 index 0000000000..abdb91fc47 --- /dev/null +++ b/keyboards/takashicompany/minidivide/minidivide.c @@ -0,0 +1,48 @@ +// Copyright 2023 takashicompany (@takashicompany) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quantum.h" + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} + +//Variable that stores the number of times the key was pressed +static uint16_t press_count = 0; + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (!process_record_user(keycode, record)) { + return false; + } + // Increment the counter when a key is pressed + if (record->event.pressed) { + press_count++; + } + + return process_record_user(keycode, record); +} + +bool oled_task_kb(void) { + + if (!oled_task_user()) { return false; } + + oled_write_ln_P(PSTR("mini"), false); + oled_write_ln_P(PSTR("Divide"), false); + + oled_set_cursor(0, 5); + + oled_write_ln_P(PSTR("Layer"), false); + oled_write_ln(get_u8_str(get_highest_layer(layer_state), ' '), false); + + oled_write_ln_P(PSTR(" "), false); + oled_write_ln_P(PSTR(" "), false); + + oled_write_ln_P(PSTR("Count"), false); + oled_write_ln(get_u16_str(press_count, ' '), false); + + return false; + +} +#endif
\ No newline at end of file |