Not sure if this is the right thread, because I've read about custom controllers on a few already, but anyway.
I'm currently building what I call a "poor man's poker", actually as a cherry POS mod (I'll hopefully post about it on geekhack soon) and I was thinking of redefining 60% keyoard experience. But then I came across this thread, and it seems that building a universal controller would be even better, so I'm definitely interested in participating (as firmware developer).
I'm now on the point of trying different features which I find useful for a mini keyboard, like conditional scancodes, layer switching and so on.
I'll just write how I would go about making a universal controller (it's basically the ideas for the firmware for my keyboard, extended for an easy to set up and use controller):
1. support for new features, that have not been used in keyboards in the market - mainly for the owners of mini keyboards (that's my basic point, as I'd like to use this firmware in my build too):
- conditional scan codes (scan code depends on the state of other keys) - useful for keys whose use together with some modifiers is very uncommon, for example on my keyboard escape is in place of tilde/backtick and shift+escape sends tilde/backtick, which results in a tilde on the computer side, and still leaves escape on the first layer
- macros - both simple series of keystrokes, and timed press/release events, so that gamers can cheat macro-aware protections in games
- layers switchable in many ways, like key state (2 layers - some key pressed and released), key stroke, ability to choose multiple keys for layer switching
- nkro support
- more to be added...
2. simple design, easy to solder and cheap to buy fully assembled, also easy to integrate into a new keyboard build. So I'm thinking teensy 2.0 or basically anything based on atmega32u4
3. support for on-the-go programming of new layouts (to me, layout means all the layers, macros, and other configuration, according to the features list). We can achieve this by adding a simple raw hid or serial port endpoint, which will use a simple binary protocol to update layouts
I was thinking how to solve configuration (matrix layout, etc) and bootstrapping (for those who build their own keyboard or mod some very old hardware, and aren't much into programming), and I have basically found three ways, two of which I have excluded:
- configuration on source code level - not good, because it requires the user to install the whole toolchain and mess with source files;
- firmware generator - hard, messy and hacky, and it requires a new version of generator for every firmware release; and the only sensible option:
- runtime configuration: if there is a gui for layout, it can also be used to program matrix connections and other features.
I see the interaction between the controller and a constructor as follows:
1. The constructor connects the matrix either to any io pins or, for simplicity, we define some of them to be columns and some to be rows and force a particular connection.
2. Optionally, the constructor assigns io pins to columns and rows of the matrix.
3. The constructor assigns key numbers to matrix coordinates using the gui and programs the keyboard with these settings. The controller saves the configuration in internal eeprom, so no reflashing, recompiling or firmware generation is necessary. Numbering the keys will make binary layouts portable between keyboards of the same number of keys, but different matrix connections.
4. Anyone who uses the keyboard programs it with layouts using the gui. The keyboard can be programmed with mutiple layouts, and the user can switch them for example with a microswitch somewhere in the back.
I'm open to comments and ideas, especially feature related.
I will write this firmware eventually anyway, so my question is, can I help the controller project by making it more generic?