-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readLEDs reporting incorrect values #61
Comments
Interesting. |
I've started investigating the issue, enabled all debug in usb_dev.c and I get the following output when any LED changes to any state (toggling them with another keyboard to make sure I only get LED packets).
So it's indeed trying to update the LEDs but not receiving the proper data from the PC. Since it happens on both Linux and Windows I suppose it might be a descriptor issue since the possibility of an OS bug is already cleared. |
The USB portion seems to work correctly for me. 0x1 - Numlock readLEDs only reads the current status. It doesn't automatically trigger when a change occurs (even though the state is recorded). I do have some draft spec details on how to use USB Leds as triggers to combinations, but I won't have time to get to do the implementation until the first set of ErgoDox issues are fixed. The easiest thing to do for now would be just to modify the led handling code here: https://github.com/kiibohd/controller/blob/master/Output/pjrcUSB/arm/usb_dev.c#L426 Now, this may be a 6KRO issue (looking at that next). |
Odd, it doesn't work for me. readLEDs always reports 0 or 1 regardless of numlock and capslock. Seems to change at random when I change the LED states. And yeah, that's exactly what I was planning to do. |
Hmm, I'm getting random status as well now. |
I think Set report should read "data" for led status instead of wdata. |
Well I just checked with usbmon, the computer is indeed sending bogus data to the keyboard and not always, while my Logitech keyboard is getting proper reports. |
I've been messing with the code. Something larger is wrong, should have a fix soon. |
Fixed. Tested under both 6KRO and NKRO modes and seems to be working. Let me know if you still have issues. |
Seems to work fine here, thanks a lot. Time to grab the soldering iron again. By the way, is the SET_REPORT function the right place to set my physical LEDs up ? Or is there a facility for that ? |
There isn't a facility (yet) unfortunately. But I'll be adding somewhere around here: https://github.com/kiibohd/controller/blob/master/Output/pjrcUSB/arm/usb_dev.c#L692 |
Thanks, I'll see what I can do with that. |
I've wired up and configured my keyboard with a Teensy 3.1, and I was hoping I could come up with a hack to enable a numpad layer (it's a Truly Ergonomic, was a hell to mod but the original controller was fried) when numlock is on.
Still haven't wired the status LEDs but it looks like the controller is not updating the LED register value properly as readLEDs always returns the value the LEDs had when plugging the keyboard in.
I have a Logitech keyboard hooked up to the same machine and the LEDs behave properly on that. I'm running Arch 64 bit and I'm affected by #58. Happens both in X11 and in the virtual console. Just tested on Windows 10 on the same machine, same issue there.
The text was updated successfully, but these errors were encountered: