diff options
author | Nick Brassel <nick@tzarc.org> | 2025-02-26 22:25:41 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-26 22:25:41 +1100 |
commit | 1efc82403bebe759272d1ba7a79d9dfa0d5df506 (patch) | |
tree | c356ae7afeb0849926534beb5dd4515f693abf99 /modules/qmk/hello_world/hello_world.c | |
parent | 63b095212b157c4522bdeda3de144fb87213085d (diff) |
Community modules (#24848)
Diffstat (limited to 'modules/qmk/hello_world/hello_world.c')
-rw-r--r-- | modules/qmk/hello_world/hello_world.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/qmk/hello_world/hello_world.c b/modules/qmk/hello_world/hello_world.c new file mode 100644 index 0000000000..d9dd366100 --- /dev/null +++ b/modules/qmk/hello_world/hello_world.c @@ -0,0 +1,33 @@ +// Copyright 2025 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#include QMK_KEYBOARD_H + +#include "introspection.h" + +ASSERT_COMMUNITY_MODULES_MIN_API_VERSION(1, 0, 0); + +uint32_t delayed_hello_world(uint32_t trigger_time, void *cb_arg) { + printf("Hello, world! I'm a QMK based keyboard! The keymap array size is %d bytes.\n", (int)hello_world_introspection().total_size); + return 0; +} + +void keyboard_post_init_hello_world(void) { + keyboard_post_init_hello_world_kb(); + defer_exec(10000, delayed_hello_world, NULL); +} + +bool process_record_hello_world(uint16_t keycode, keyrecord_t *record) { + if (!process_record_hello_world_kb(keycode, record)) { + return false; + } + + switch (keycode) { + case COMMUNITY_MODULE_HELLO: + if (record->event.pressed) { + SEND_STRING("Hello there."); + break; + } + } + + return true; +} |