eccherda / ch552g_mini_keyboard

alternative firmware for 3 keys rotary encoder usb keyboard from aliexpress using ch552
Other
22 stars 4 forks source link

Encoder button press not enabled #2

Open aptonline opened 3 months ago

aptonline commented 3 months ago

Using the current configuration the encoder button doesn't appear to be captured. How would I enable this?

aptonline commented 3 months ago

So I've added the following to the configuration.cpp file:

[BTN_ENC] = {
                .type = BUTTON_SEQUENCE,
                .function.sequence = {
                    .sequence = {KEY_MUTE}, // Mute
                    .length = 1,            // Lengh of sequence
                    .delay = 0             // no delay
                }

and also added the following to the USBHIDKeyboardMouse.h file in src/userUsbHidKeyboardMouse

#define KEY_MUTE 0x63 // Keyboard Mute
#define KEY_VOLUMEUP 0x80 // Keyboard Volume Up
#define KEY_VOLUMEDOWN 0x81 // Keyboard Volume Down

The encoder button now appears to be registered just not doing what I want it to do on my keyboard. I think I need to find the correct scan code for the F10 key on my Mac.