Beware programmers that carry screwdrivers!

I take a certain small amount of joy in the fact that, having discovered that my problem when testing my new USB HID program was that the test device itself was broken, I unscrewed the device's case, cleaned out some gunge, took the plastic shipping protection tab off the battery (sic!), put it all back together again; and it is working.

I'm not sure whether it was the muck or the lack of power that was the problem. I'd been operating it with only host power for some years, it has transpired; and maybe that was not quite enough to properly drive the keyboard matrix. (The optical mouse part was still working on host power.)

Now I can type digits on my USB calculator in its "PC" mode and see them come up on the computer screen. Hurrah!

I was on the verge of going to e-Bay and paying some bloke in Manchester a tenner for a new one. (-:

#ComputerProgramming #HardwareRepair #BigClive #USBHID

This has led to two interesting, albeit expected, discoveries about the Lexibook USB Calculator:

1. Even though it physically has no lock keys nor LEDs, it knows about the NumLock LED and advertises via its USB report descriptions that it has LEDs.

This is so that it can track NumLock state; and when it sends (say) a "9" digit, it fakes a NumLock keypress to turn NumLock on before sending the HID usage for the "9" key on the calculator keypad.

I can see the NumLock flashing briefly on, on the other keyboard that I have configured to share the modifier state; as well as the codes in the USB input reports.

2. Even though it has a "00" key, even though it is a USB-only device, even though USB defines a HID usage for a "00" key on a calculator, and even though that appears to have been in the spec since 1996 … it still sends two successive [0] keypresses.

It doesn't send the right HID usage for its [±] key, either.

#ComputerProgramming #HardwareRepair #BigClive #USBHID

I feel very much at the cutting edge of 1996 with console-usb-ugen-realizer supporting the actual USB HID usages of both [00] and [±] on calculator keypads, as well as a whole load of other such keys e.g. [%], [⌦], [(], and [)].

I get the impression from my test devices not sending even [00] that operating systems have not generally done this; and that today in 2025 I am in the vanguard of supporting things that have been on electronic calculators since the 1970s.

#nosh #uservt #USBHIDs

The Canon LS 120PC (USB calculator, not what most of us think of as "LS-120") is fairly dopey by comparison to the Lexibook. It, too, advertises LEDs that it does not physically have.

But if NumLock is off, it simply refuses to go into "PC" mode at all, and remains stuck in calculator mode. So either one must configure NumLock to be initially set on, or have another keyboard with shared state that one can use to turn NumLock on.

It's an alternative way of handling the NumLock problem for calculator keypads. But a worse one, I think. One never has "Oh, the mode switch key isn't working because I forgot to set NumLock on. Again." moments with the Lexibook's approach.

#ComputerProgramming #HardwareRepair #BigClive #USBHID