Single-byte key addressing (for boards with fewer than 256 keys)

Ok, guys. I won’t continue to insist in any type of implementation. My class sketch of KeyAddr was just a suggestion.

Possible. Eventually, programming discussions always end at philosophy, same as parties end in the kitchen (not sure if this saying exists in english).

1 Like

And I think it has. :slight_smile:

I’ve worked with C++ when templates were still relatively new, and I’ve worked with the Boost STL. And I prefer not to work with C++ any more. I don’t think these things are completely unrelated.


I continuously work with C++ for almost 20 years now. It’s not that bad. Actually, It’s my favorite language. No other language allows to generate such lengthy discussions :grinning:

1 Like

Have you not heard of Perl 6? :wink:


We can. The hard part with a Planck port is the Teensy, because that needs a different HID library, as far as I remember. There has been same work on that front before, and I plan to revisit that soon for various reasons. Once we make it easier to use different HID libraries, and dispatch events between them, a whole lot of things get easier. Including porting to Teensy-based platforms. Once that code is in, the Planck port should be doable in an afternoon.

Key addressing is a non-issue when porting to keyboards that use the exact same MCU under the hood (the Teensy in the Planck has the same Atmega32u4 processor in it as the Model01, the Shortcut, and Raise). It would become an issue only when porting to a keyboard with more than 255 positions in its matrix. I don’t see that happening anytime soon. And even then, putting the typedef in the hardware plugin would solve most of the portability problems.

I must honestly confess that I switched from Perl to Python before Perl 6 came along. But I seem to have missed something.

Nice. Thank’s for the info. I am looking forward to the Teensy port. My ErgoDox might like it too.

I was referring primarily to the 15 years it took from the start of the design discussions to the “1.0” release.

That must be a hell of a language now.

Not true if there are holes in the key matrix, which I believe @algernon said is true of the Shortcut.

Based on my experience dealing with it for the past month or so, I’d say it’s not the STL (which isn’t even available to Arduino, apparently) – it’s the whole language that’s gone off the rails. You cannot imagine how much I hate C++ right now.

1 Like

Can you explain the difference between the hardware on a Planck (and/or Preonic) and the Model01? I’ve looked it up (or tried to) a few times, and all I can remember is that sometimes I look it up and it’s the same, and other times it’s different.

Does holes mean that there are unused entries in the keymap matrix?

Sorry to hear that. Can I do anything to reduce your hatred towards C++? Explanations, links, etc.


All those XXX stuff, those are positions that are not wired anywhere.

There are unused positions in the keymap. But when itetrating over the keymap, those holes could probably be ignored. It would in any case not pay off to stop and restart an iteration over the keymap because of five unused elements (shortcut).
In any case this would require no changes in the key addressing implementation.

Wouldn’t it only be a problem if (ROWS * COLUMNS) >= 256 but the number of total keys is still less than 256?

I would write a hardware module for any keyboard that simply assigned a number to each keyswitch in series, so the following test guaratees that it addresses a valid key:

if (key_addr < TOTAL_KEYS) { ... }

I would not want to expose ROWS and COLS to the rest of Kaleidoscope at all. From the top level, I’d still want the user to be able to refer to keys using some sort of coordinate system (with a compile-time translation), but that would probably only be the same as the hardware’s row and column wiring on keyboards like OLKB ones. I personally find the R#C# coordinates on the Model01 difficult to remember; past the sixth column, and I can never get any of them right. I see six rows on each half of the Model01, not four, and not all of them have the same number of keys. And tab is in the second row (I had to look it up) next to T, but it clearly ought to be next to G in the third row…

Alas, the more I learn, the more I despise it. Being unable to do conceptually simple things because of lack of familiarity is mildly frustrating and time-consuming, but the real loathing comes when I learn the solution.


See also