Hey, a little late to the party, but...
mrog wrote:Anyway I was thinking about the possibilities of the teensy/ardunio board, and what I could do with the ability to intercept the keypresses before sending them to the pc.
You could borrow some ideas (or code!) from Hasu's HH mod - notably, he makes some key combos act as a mouse, so you can move a pointer without taking your hands off the keyboard.
Code:
https://github.com/tmk/tmk_keyboardStory:
http://geekhack.org/showwiki.php?title=Island:12047My initial idea is to write some on the fly keyboard remapping/swapping and macro recording and playback - probably initialized by some special key combination to start recording macros and assign key buttons, perhaps I can throw in some profiles etc.
Sounds fun.
The more I think about features the more I think I need some sort of display...
This may not be what you're looking for, but PJRC sell a screen they've made work with a Teensy:
http://pjrc.com/store/dev_display_128x64.html(Seems to take up 20-ish pins.)
Instead of a display, have you considered using the keyboard's output? So, you would switch to a text editor on your computer (or just run
cat), press some keyboard combo to enter some diagnostic mode on it, and the kbd would send its output to the computer as if you're typing it. You would see it on the screen. It could even have menus and a help system ("{D}elete all macros, {L}ist macros....")
Anybody know a good guide to keyboard wiring, how many inputs do I need for NKRO?
NKRO is about communication between the controller and the computer, it doesn't enter into the number of wires.
For maximally-useful NKRO, of course you also want anti-ghosting, but that also doesn't affect the number of wires, as long as you can stick in a diode next to each switch. (If you can't, forget anti-ghosting - it would then need a dedicated pin for every key.)
Also, NKRO (unlike anti-ghosting) is overrated. How often do you really need to register 7 (non-modifier) keys at the same time?
Simplified: The number of pins you need is roughly double the square root of the number of keys.
17 pins would be enough for a mini keyboard of 65-72 keys, 21 pins for a full-sizer (101-110 keys), 23 pins for some beast with up to 132 keys. You could shave down the key count a little by wiring the two Ctrls together or something.
For completeness: If you don't mind sticking in a bunch of demultiplexers or similar gates, you could actually manage most real-world keyboards with just 8 controller pins. This is probably not worth the trouble - for the extra $1 they cost, and the space they'll take, you could just get a bigger controller.
Theoretically, if you're willing to put increasingly complex electronics between the controller and the switches, you can reduce the pin count further, but that's really only a good idea if you're doing this as an electronics challenge, not if you just want to hack a kbd.