Strange Keybow Issue

HI Everyone,

I have been using a Keybow on and off for about 18 months and on the whole it works well, however I have come across an irritating issue that has stated since I have started using it again for a while.

I have got the following bit of code assigned to a key:-

function handle_key_02(pressed)
keybow.text(“EMAILED 26-11-2020”)
keybow.tap_enter()

What happens is that it repeats the text twice, i.e. it outputs:-

EMAILED 26-11-2020
EMAILED 26-11-2020

I have formatted the card and downloaded the latest version of the Keybow OS but I am still getting the issue.

I have used the standard number pad layout and just changed the code for this one key, all the other numbers work as expected!

Any help is greatly appreciated. TIA

Hi,

I think what you need is:

function handle_key_02(pressed)
    if pressed then
        keybow.text(“EMAILED 26-11-2020”)
        keybow.tap_enter() 
    end
end

This will only run the code on the down stroke and not the up stroke.

This might be handy:

Hi,

I must be doing something wrong, when I replace the default code for a key i.e.:

function handle_key_06(pressed)
keybow.set_key(“4”, pressed)
end

with the code you suggest nothing happens, not even the other keys that still has the default number pad assigned to them.

Double check the indentation of the code (number of spaces at the start of a line).

If that gets out of whack it can really mess things up.

While you check the spacing as @major_tomm mentioned, also make sure your editor didn’t replace the 8 leading spaces on the third and fourth lines with a single tab each. That would really confuse things.