You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
4.7 KiB

  1. * The "Cadet-Style" keymap for the melody96.
  2. * Author: Yonatan Zunger (zunger@gmail.com)
  3. This is an experimental keymap being used both for practical reasons (as my daily driver) and to
  4. work out the ideas of a "space-cadet-style" keyboard which can type text and mathematical symbols
  5. with equal ease. It's designed for anyone who frequently needs to do this outside of a LaTeX
  6. environment, or for anyone who loves the old "Space Cadet" keyboard! And it works at its best when
  7. you have actual Cadet keycaps (like SA Symbolics) installed, because those keycaps will actually
  8. show what you get.
  9. The core idea of this keyboard is that, in addition to a QWERTY base layer and a function layer, it
  10. supports two additional base layers -- the GREEK layer (the analogue of the Space Cadet "Greek," or
  11. "Front," keys) and the CADET layer (the analogue of the Space Cadet "Top" keys). These layers use
  12. Unicode to generate all of the mathematical symbols you can find on a traditional Space Cadet
  13. layout, plus a bunch of extras.
  14. Because Unicode can't be encoded using the traditional USB HID protocol, QMK does some clever but
  15. horrifying things to fool your OS. One consequence of this is that the shift key needs to be handled
  16. by the keyboard firmware, not the host OS. To handle this, we have two additional layers --
  17. SHIFTGREEK and SHIFTCADET -- and handle the flipping between all of these layers here in the
  18. firmware.
  19. *The simple bit: Using this layout on a Melody96*
  20. At the core of this layout are three special modifier keys and two special lock keys:
  21. * The GREEK key, to the right of the spacebar, activates the GREEK layer. GREEK+SHIFT activates
  22. SHIFTGREEK. These keys generate Greek letters on the letter keys (thus the name), and a few
  23. mathematical symbols on other keys. They correspond to the notations on the front of traditional
  24. Space Cadet keys; if your capset doesn't include those (alas, most don't), they're the "pretty
  25. obvious" mappings.
  26. * The CADET key, to the right of GREEK, activates the CADET layer. These are the symbols above the
  27. letters on a Space Cadet layout. CADET+SHIFT activates the SHIFTCADET layer, with even more
  28. symbols.
  29. * The FUNCTION key, to the right of CADET, activates the function layer. This is where you have a
  30. reset mechanism, a selector for which Unicode input type you want, and so on.
  31. Additionally, GREEK+ALT is equivalent to CADET. This is handy for other keyboards where you don't
  32. have room for this many modifiers.
  33. The lock keys are:
  34. * Caps lock, if you use it, will also act as a "shift lock" for the Greek and Cadet layers. Shift
  35. lock is slightly different, in that while it is engaged shift will _dis_engage it; that's actually
  36. pretty useful when typing math.
  37. * An additional "layer lock" key, by default where "num lock" usually goes, will lock the choice of
  38. base layer. To use it, hold down any invocation of the GREEK or CADET layers, or none at all, and
  39. hit lock; it will then put you in that layer. The corresponding modifier key will then toggle you
  40. back to the QWERTY layer. (So for example, if you hit GREEK+LAYER_LOCK and release them, you're
  41. now typing in Greek; the GREEK modifier would cause you to type QWERTY momentarily. To go back to
  42. ordinary QWERTY mode, you'd just hit LAYER_LOCK again with no modifiers held)
  43. To see the full layout, check out the big comment in keymap.c.
  44. *A less-simple bit: Adapting this to other keyboards*
  45. This is really a canary for generic Cadet implementations. Before this can be made generic, a few
  46. things will have to happen:
  47. (1) Instead of a fixed keymap, this has to be refactored into some kind of array showing the
  48. mappings of QWERTY-layer keys onto the appropriate code points in the GREEK and CADET layers, and
  49. some preprocessor magic needs to auto-transform this plus a traditional keymap for the QWERTY layer
  50. into keymaps for all five of the core layers. (Function layers would presumably be handled on a
  51. per-keyboard basis)
  52. (2) The standard mapping of those should have some #define's to control things like whether there
  53. are physical F-keys (you would probably want to move superscript and subscripts onto the numbers if
  54. there weren't, and figure out what to do with the non-numeric super/sub keys), whether you actually
  55. want to enable GREEK+ALT=CADET, and so on;
  56. (3) There should be support for controlling indicator LEDs based on the base layer selection,
  57. caps/shift lock state, and layer lock state, as well as for triggering audio on transitions;
  58. (4) All the core fancy logic in process_record_user which implements the layer handling should be
  59. factored out into its own function, so that keyboards can easily reuse that, too.
  60. This is a lovely TODO for future work, and could be particularly fun to go along with new releases
  61. of SA Symbolics and the like. Anyone interested in such things, ping me!