Karabiner-elements: Reordering keypresses for Ergodox Infinity firmware

Created on 31 Oct 2016  路  8Comments  路  Source: pqrs-org/Karabiner-Elements

After upgrading to Sierra and starting to use Karabiner-Elements (KE) as a replacement for Karabiner, I noticed that the macros on my Ergodox Inifinity stopped firing consistently. I first filed an issue over there and through some digging, it was determined that KE was reordering the keypresses and it appeared to be sending CTRL 5 instead of SHIFT 5. Check out the thread and let me know if you need help testing a fix since it's more likely that you don't have an Ergodox Infinity as well.

Most helpful comment

I've gotten such a device and fixed this issue at the latest version (v0.90.73)

All 8 comments

Karabiner-Elements uses IOHIDQueueRegisterValueAvailableCallback to get hid events.
Does the IOHIDQueueRegisterValueAvailableCallback get your devices event properly?

An example of confirmation:
There is an example program of IOHIDQueueRegisterValueAvailableCallback.
https://github.com/tekezo/Karabiner-Elements/tree/master/appendix/dump_hid_value

Checkout Karabiner-Elements source tree and build it.
https://github.com/tekezo/Karabiner-Elements/#how-to-build

Then

$ cd appendix/dump_hid_value
$ make
$ make run

Open EventViewer and type keys on your device, the HID values will be output in Terminal.
They are the result of IOHIDQueueRegisterValueAvailableCallback.

Check out @gibfahn's comment on the issue I referenced in the description. It sounds like he already inspected what is being sent. It looks like it's receiving CTRL instead of SHIFT.

https://github.com/kiibohd/KiiConf/issues/63#issuecomment-257102499

I cannot reproduce this issue without device.
Thus I cannot distinguish whether it is IOKit issue or Karabiner-Elements issue.

@tekezo Was what @gibfahn did not enough to act on? I'll take a look at observing the behavior and documenting the output tomorrow night and report back.

Karabiner-Elements does not reordering the input events at least in the source code level.

So, I guess this issue is depending on macOS (IOKIt) specification of handling input events.
(For example, IOHIDQueue might reorder input events unless the enough interval between events.)

We have to know the detail of event handling in IOKit in such devices.
But I don't have devices which can reproduce this issue, so I need to your help to know the IOKit behavior.

Completely fair, thanks for the response. I'll build and let you know what I find. I'd love to get this resolved so I can continue using KE.

Thanks for all the work on this project. Looking forward to seeing it progress.

I've gotten such a device and fixed this issue at the latest version (v0.90.73)

馃憤馃憤馃憤 This is great news! I had just resigned to not being able to use KE for my keyboard. I'll have to dive back into the project and see how things are going. Thanks for all the work you do on Karabiner and now Karabiner Elements!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ox0400 picture Ox0400  路  3Comments

PSalant726 picture PSalant726  路  3Comments

impala75 picture impala75  路  3Comments

Fengur picture Fengur  路  3Comments

LittleNewton picture LittleNewton  路  3Comments