pimoroni / keybow-firmware

Keybow Firmware for the Raspberry Pi Zero
Other
182 stars 67 forks source link

macros running twice #75

Closed GalacticSerialBus closed 1 year ago

GalacticSerialBus commented 3 years ago

When I use macros or snippets that use set_modifier(), the macro will run twice. It seems to be running once when I press the button down then again once the button is released. this doesn't happen when I use the set key modifier by itself.

Gadgetoid commented 3 years ago

Do you have some example code? All of the key handlers are called on press/release so you usually need to check the state and do the right thing.

jolo1581 commented 2 years ago

@GalacticSerialBus When I tried first, I got the same problem.

I solved it with:

function handle_minikey_01(pressed)
    if pressed then
        -- add code to execute on key press here 
    else
        -- do nothing on release
     end
end

Greetz Jan