AEK II and tmk_keyboard - how to the keep Numlock LED on?

FritzTheGerman

27 May 2020, 22:47

Hello,

I'm using an AEK II with a Teensy 2.0-based ADB to USB converter. Software is the great tmk_keyboard code from Haus.

Now I would like keep the Num-Lock LED on, as kind of power LED, since on OSX the numpad is already always in numeric mode.

So far, I've managed to turn the Num-Lock LED on when the Teensy / keyboard is "booted". But when I engage Caps Lock, the Num-Lock LED goes off and keeps off. The Caps Lock LED is behaving normal.

To achieve this, I call "led_set(1);" instead of the normal "led_set(host_keyboard_leds());" in the matrix_init function of matrix.c.

I've tried to find the right place where I can hook into the "caps-lock"-routine, but I didn't managed to find it in the source code.

Any hints and help are appreciated.
Last edited by FritzTheGerman on 28 May 2020, 12:07, edited 1 time in total.

MMcM

28 May 2020, 01:42

At the end of that same file, modify led_set itself to or in bit 1 before calling adb_host_kbd_led.

FritzTheGerman

28 May 2020, 08:53

Solved it - an additional change in hook.c keeps the NumLock LED permanently on.

Code: Select all

__attribute__((weak))
void hook_keyboard_leds_change(uint8_t led_status) {
// " | 0x01" to keep NumLock LED permanently on
    keyboard_set_leds(led_status | 0x01);
}
Thanks for the help!

Post Reply

Return to “Keyboards”