Count keystrokes?

Mechanical keyboard switches often mention their lifespan – 50 million keystrokes, or whatever.

That sounds like a lot – but how many keystrokes do I make in, say, a typical day?

I also sometimes think about how expensive my UHK (and all its accessories) is – but on a per-day or per-keystroke basis, it’s probably pretty affordable considering how much I enjoy using it.

I’d love to be able to quantify those things. Is there any way the UHK could somehow track keystrokes? Maybe something in the Agent that would report on just the total number of keystrokes recorded since such-and-such a time. (Of course, even better would be keystrokes on a per-key basis, but the overhead of tracking and the memory for storing that is probably too much.)

I’m pretty certain this isn’t possible, but I wanted to mention it as an idea that would be pretty neat. I’d certainly like to have some idea of how many keys I press on a typical day…

How would you store the number when the keyboard gets rebooted whenever the USB power is disconnected? (e.g. you restart your PC, you disconnect your Laptop etc.)

If you write every keystroke count to non-volatile (flash) memory, your flash memory will be dead in a week. If you don’t write it to non-volatile storage, you loose the counter whenever the keyboard looses power.

Any chance you could count USB keyboard events on your PC side? This could be used quite easily to estimate the amount of keypresses that were done.

If you write every keystroke count to non-volatile (flash) memory, your flash memory will be dead in a week.

I don’t know the details of the flash memory used by the UHK; it sounds like it’s not as durable as the flash memory in SSDs and the like. I guess the keyboard could only write the count to the memory every, say, 15 minutes, but it sounds like that would still be quite a lot of wear on the memory.

It does seem like counting keystrokes on the PC would be better. Sadly, I use my UHK at work where I can’t just install any software I like, and I doubt they’d approve installing such software since it’s really just something I’m curious about.

Alternatively, it would be neat to make, say, a Raspberry Pi with a microphone that would listen continuously and have some kind of signal processing that listens for keystrokes – I’m sure it’s not too hard to train up some kind of machine learning algorithm for that. (Abstractly, it’s basically edge detection.) But that’s getting way too far into the weeds for what is basically just idle curiosity on my part.

That’s a fancy idea! :slight_smile:

I’d rather create a tiny USB2USB device that instead of mapping keys would just run an adapted firmware that counts. Again, now you need to store your counters. (You’d need to do that on the Raspberry Pi too.) Maybe a device with a SD-Card? Ah, you’re going to wear that SD card. :smiley: