summaryrefslogtreecommitdiff
path: root/keyboard/planck
diff options
context:
space:
mode:
authorChristopher Browne <cbbrowne@ca.afilias.info>2016-02-01 18:50:19 -0500
committerChristopher Browne <cbbrowne@ca.afilias.info>2016-02-01 18:50:19 -0500
commit91c46816568ce76ff22b3c469ff1d624b96a535e (patch)
tree3d2269cdd4ce531b840f03e45ae710711321729a /keyboard/planck
parent41c17baccf858980dfd387400ab3347dc5b5028e (diff)
downloadqmk_firmware-91c46816568ce76ff22b3c469ff1d624b96a535e.tar.gz
qmk_firmware-91c46816568ce76ff22b3c469ff1d624b96a535e.zip
More samples, some not entirely working yet.
I am trying to mess around with MACRO(), but it is not there quite yet...
Diffstat (limited to 'keyboard/planck')
-rw-r--r--keyboard/planck/keymaps/cbbrowne/keymap.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/keyboard/planck/keymaps/cbbrowne/keymap.c b/keyboard/planck/keymaps/cbbrowne/keymap.c
index bd09f65c87..97ef72407d 100644
--- a/keyboard/planck/keymaps/cbbrowne/keymap.c
+++ b/keyboard/planck/keymaps/cbbrowne/keymap.c
@@ -44,6 +44,15 @@
- What's the keystroke to get from X to console these days?
- I do indeed want a sweet number pad!
- A layer for doing console switching would not be a bad idea
+ - Random data generator
+ - A key that generates values in the range 0-9 at random
+ - A key that generates values in the range a-z at random
+ - A key that generates values in the range a-z,A-Z,0-9 at random
+
+ - Figure out the MACRO example in https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/doc/keymap.md
+ - section 2.3.2
+ - where does the HELLO come from???
+ - What are the types of the T() calls?
*/
enum layers {
@@ -126,17 +135,21 @@ const uint16_t PROGMEM fn_actions[] = {
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
- switch(id) {
- case 0:
- if (record->event.pressed) {
- register_code(KC_RSFT);
- #ifdef BACKLIGHT_ENABLE
- backlight_step();
- #endif
- } else {
- unregister_code(KC_RSFT);
- }
- break;
- }
- return MACRO_NONE;
+ switch(id) {
+ case 0:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+#ifdef BACKLIGHT_ENABLE
+ backlight_step();
+#endif
+ } else {
+ unregister_code(KC_RSFT);
+ }
+ case 2550:
+ return (record->event.pressed ?
+ MACRO( I(55), T(C), T(B), T(B), T(R), T(O), T(W), T(N), T(E)) :
+ MACRO_NONE );
+ break;
+ }
+ return MACRO_NONE;
};