Skip to content

Adding media keys to a layout leaves keyboard in non-functional state #38

@JamesHagerman

Description

@JamesHagerman

Hello again,

I got into trouble with one half of my Corne LP+Blox keyboard failing to boot after adding VOL UP, VOL DN, or M PLAY to my layout.

After backing up the python files, wiping the keyboard, setting it up again, and manually changing the main.py using trial and error, these three key codes are not working correctly.

Turns out that adding any one of them to my layout in the client and saving the map causes the keyboard to be stuck with the OLED screen saying main.py output: (but there isn't enough screen space to show the output...). Unplugging and plugging that half leaves it in an unbooted state.

It still mounts as a file system, but the keyboard code doesn't run.

After some digging and testing, it looks like these two lines are not being added to the main.py when media keys are added to the layout:

from kmk.extensions.media_keys import MediaKeys
keyboard.extensions.append(MediaKeys())

This is documented in KMK here: https://github.com/KMKfw/kmk_firmware/blob/master/docs/en/media_keys.md

Manually adding these lines to the main.py gets the keys working as expected.

I'm not sure how these imports are supposed to be populated but they are (clearly) removed when the main.py is re-generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions