I feel like there is a lot of input lag

I finally got around to unpacking my keyboard and I am having a nice challenge re-learning to type.
I can’t wait to dive into the customization in the near future, but I feel that there is sometimes a large lag between the key being pressed, and the letter appearing on screen. I’ve not done any modifications yet and wondering if a firmware update is in order.

While the factory firmware shouldn’t be slow, it’s definitely not the fastest one out there. We’ve done some pretty significant optimisations recently, so updating should help.

Oh, one question: are you using any LED modes when you experience input lag? Some of the LED modes are pretty expensive, and might very well result in reduced performance.

Even with the slowest LED mode (which I’m pretty sure is LEDEffect-Breathe), I’d be surprised if someone could detect input latency from the keyboard itself with the factory firmware.

With Qukeys set up, on the other hand, lag is definitely perceptible…

Does lag affect all keys, or only those that are mapped as Qukeys?

It delays sending reports for any qukey and any key that’s pressed while a qukey is still held until either one of those keys is released or the qukey times out (~200ms default). In practice, this means qukey characters are delayed until key release, but other keys are not. If you’re typing at a reasonable speed, you probably won’t notice unless you’re looking for it.

@merlin I started seeing this today. I have both the Mac keyboard attached and the Keyboardio. I have a key set up as SFT_T(8). When I hold down the key I can see the delay on the keymap layout for the video editing system I use compared to when I just press the standard shift key on the mac keyboard which is instant.

I noticed this first in the editing application as Shift+Command allows me to move video clips from one track to another locked in place (unable to move left or right, only up or down)
I would press the SFT_T(8) and my Key_LeftGui key and I’d be able to move the clip all over the timeline but if I hold shift and wait a second and then press Key_LeftGui it does the expected behavior.

I assume this is for it to detect whether its just being tapped compared to held for the dual use function? I thought I remember a thread in where you mentioned changing the default timeout, but can’t find it. Is it worth messing with that or is this just the expected behavior for now?

With some more testing this morning I also noticed as I’m typing and I want to capitalize the first letter of my name for example I am getting 8darren instead of Darren, if I pause a moment before typing the D I then get the wanted result of Darren. Do you think it’s best not to use Qukeys with modifiers or just get used to slowing down my typing.

I’m not sure I understand your problem fully, but it sounds like you’re expecting alternate (i.e. modifier) behaviour from a Qukey in the case of rollover, where two keypresses overlap, but the first one pressed is also the first one released. That’s not how it is designed to work — a Qukey only takes on its alternate keycode if a subsequently-pressed key is released before the Qukey is released. There is an option to set a release delay, so if two keys are released simultaneously, the Qukey will be treated as its alternate keycode.

1 Like

Sorry, I thought I might of gone a little too in depth and should of just stuck with the capital letter reference.

And after reading what you said I have tested it a bit more and it’s definitely my typing that is the problem. If I use both hands and press my SFT_T(8) key along with the letter d, I get a capital D. When I use just one hand ( I have the Qukey set on pgup) and use my pinky to press that and hit d with my middle finger, I think my pinky must be releasing it sooner than the d is pressed, because sometimes I get the capital D and sometimes 8d.

Still getting used to this thing and obviously need to practice more typing! :wink:

1 Like

Sorry about the lack of detail in my previous reply (I’m away from home at the moment). Before you go blaming your own “bad habits”, you might want to try adding this line the your sketch:

Qukeys.setReleaseDelay(20);

A few other people who are in the habit of releasing modifiers simultaneously with the keys they modify have found it useful. The parameter is the number of milliseconds of “grace period” to wait after Qukey release before setting its keycode value. If a subsequently-pressed key is released during that grace period, it is treated as if it was released before the Qukey, not after (and thus, you’d get the shift instead of the 8). The danger is, of course, that if you set the value too high, you might get an error the other way, and get a modifier instead of a normal key on a tap with rollover, which could have much more undesirable results.

1 Like

I’ll give it a go, Thanks! Which part of the sketch do I add this to?

Anywhere in setup(), but after Kaleidoscope.use(), just to be sure.

That’s what I thought but i keep getting this error when checking it:

Arduino: 1.8.5 (Mac OS X), Board: “Keyboardio Model 01”

/Users/macssd/Documents/Arduino/Model01-Firmware/Model01-DH_Firmware/Model01-DH_Firmware.ino: In function ‘void setup()’:
Model01-DH_Firmware:325: error: ‘class kaleidoscope::Qukeys’ has no member named ‘setReleaseDelay’
Qukeys.setReleaseDelay(20);
^
Model01-DH_Firmware:371: error: expected ‘;’ before ‘)’ token
);
^
Multiple libraries were found for “HID.h”
Used: /Users/macssd/Documents/Arduino/hardware/keyboardio/avr/libraries/HID
Not used: /Users/macssd/Library/Arduino15/packages/arduino/hardware/avr/1.6.21/libraries/HID
exit status 1
‘class kaleidoscope::Qukeys’ has no member named ‘setReleaseDelay’

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

It sounds like you don’t have the most recent version of Qukeys — the release delay functionality was just added to the master branch recently.

OK So the whole github and terminal thing I’m a little slow at, but I was able to refresh both the model 01 firmware directories and Qukey using:

cd $HOME/Documents/Arduino/hardware/keyboardio/avr
make update-submodules

and

git submodule add https://github.com/gedankenlab/Kaleidoscope-Qukeys.git Kaleidoscope-Qukeys

but now how do I re- flash the keyboardio with the updated firmware? I tried but its has not updated Qukeys.

EDIT: I figured this out this morning. It put the updated Qukeys master in my avr folder so I moved it to the library folder over writng the old version. I will test this out today. Thanks!