From 8d9e8f724966951f21e700ac72b7f073ab5c561f Mon Sep 17 00:00:00 2001 From: brettm12345 Date: Fri, 7 Feb 2020 01:06:58 -0500 Subject: [PATCH 1/6] Added my config --- keyboards/hhkb/keymaps/brett/config.h | 22 +++++ keyboards/hhkb/keymaps/brett/keymap.c | 120 +++++++++++++++++++++++++ keyboards/hhkb/keymaps/brett/readme.md | 13 +++ keyboards/hhkb/keymaps/brett/rules.mk | 4 + users/brett/brett.c | 109 ++++++++++++++++++++++ users/brett/brett.h | 30 +++++++ users/brett/rules.mk | 1 + 7 files changed, 299 insertions(+) create mode 100644 keyboards/hhkb/keymaps/brett/config.h create mode 100644 keyboards/hhkb/keymaps/brett/keymap.c create mode 100644 keyboards/hhkb/keymaps/brett/readme.md create mode 100644 keyboards/hhkb/keymaps/brett/rules.mk create mode 100644 users/brett/brett.c create mode 100644 users/brett/brett.h create mode 100644 users/brett/rules.mk diff --git a/keyboards/hhkb/keymaps/brett/config.h b/keyboards/hhkb/keymaps/brett/config.h new file mode 100644 index 000000000000..5c60fd1abc86 --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/config.h @@ -0,0 +1,22 @@ +#ifndef CONFIG_BRETT_H +#define CONFIG_BRETT_H + +#include "../../config.h" + +// Define mousekey settings +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 2 +#define MOUSEKEY_TIME_TO_MAX 5 +#define MOUSEKEY_WHEEL_DELAY 0 + +#define LSPO_KEY KC_9 +#define RSPC_KEY KC_9 +#define LSPO_MOD KC_LSHIFT +#define RSPC_MOD KC_RSHIFT + +// This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when +// you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) +#define IGNORE_MOD_TAP_INTERRUPT + +#endif diff --git a/keyboards/hhkb/keymaps/brett/keymap.c b/keyboards/hhkb/keymaps/brett/keymap.c new file mode 100644 index 000000000000..38acc49c2aea --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/keymap.c @@ -0,0 +1,120 @@ +/* -*- eval: (turn-on-orgtbl); -*- + * Brettm12345 HHKB Layout + */ +#include QMK_KEYBOARD_H +#include "brett.h" + +enum layers { + BASE = 0, + HHKB = 1, + PROG = 2, + MOUSE = 3 +}; + +// Tap for tab hold for MOUSE +#define TAB_MOUSE LT(MOUSE, KC_TAB) + +// Tap for space hold for PROG +#define SPACE_PROG LT(PROG, KC_SPC) + +// Tap for ESC hold for CTRL +#define CTL_ESC CTL_T(KC_ESC) + +// Tab for ; hold for PROG +#define PROG_SCLN LT(PROG, KC_SCLN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* BASE Level: Default Layer + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backspace | * | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | Control | A | S | D | F | G | H | J | K | L | ; | ' | Return | ****** | * | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + | LShift | Z | X | C | V | B | N | M | , | . | / | RShift | HHKB | ****** | * | + |---------+---+---+---+---+---+---+---+---+---+---+--------+--------+-----------+---| + + |------+------+----------------------------+------+------| + | LAlt | LGUI | ******* Space/Prog ******* | RGUI | RAlt | + |------+------+----------------------------+------+------| + */ + + [BASE] = LAYOUT( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + TAB_MOUSE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, PROG_SCLN, KC_QUOT, KC_ENT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(HHKB), + KC_LALT, KC_LGUI, SPACE_PROG, KC_RGUI, KC_RALT), + + /* HHKB Level: Function Layer + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | PWR | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | Caps | Calc | Mail | Media | Browser | My PC | Browser | u | i | o | Print | [ | ] | Backsp | * | + | | | | Player | Refresh | | Favorites | | | | Screen | | | | | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | Control | Prev | Next | Find | f | g | Browser | Browser | Browser | Browser | ; | ' | Exec | ****** | * | + | | | | | | | Back | Home | Search | Forward | | | | | | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + | LShift | Vol+ | Vol- | Mute | Select | b | n | m | , | Again | Browser Search | RShift | HHKB | ****** | * | + |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| + + |------+------+----------------------+------+------| + | Menu | LGUI | ******* Play ******* | RGUI | Menu | + |------+------+----------------------+------+------| + */ + [HHKB] = LAYOUT( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, KC_CALC, KC_MAIL, KC_MSEL, KC_WREF, KC_MYCM, KC_WFAV, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_BSPC, + KC_TRNS, KC_MPRV, KC_MNXT, KC_FIND, KC_TRNS, KC_TRNS, KC_WBAK, KC_WHOM, KC_WSCH, KC_WFWD, KC_TRNS, KC_TRNS, KC_EXEC, + KC_TRNS, KC__VOLUP, KC_VOLD, KC_MUTE, KC_SLCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AGIN, KC_WSCH, KC_TRNS, KC_TRNS, + KC_MENU, KC_TRNS, KC_MPLY, KC_TRNS, KC_MENU), + + + /* Programming Level: Symbols Layer + |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| + | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| + | Tab/Mouse | => | @ | >>= | =<< | ‖ | <> | <|> | <*> | <@> | |> | <$ | $> | Backsp | * | + |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| + | Esc/Control | -> | * | <$> | <#> | && | Left | Down | Up | Right | :: | ` | Return | ****** | * | + |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| + | LShift | z | x | c | v | b | n | m | <- | -> | <> | Shift | HHKB | ****** | * | + |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| + + |------+------+----------------------------+------+------| + | LAlt | LGUI | ******* Space/Prog ******* | RGUI | RAlt | + |------+------+----------------------------+------+------| + */ + [PROG] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, FAT_ARROW, KC_AT, BIND, BIND_FLIPPED, OR, CONCAT, ALT, APPLY, FLAP, PIPE, VOID_LEFT, VOID_RIGHT, KC_TRNS, + KC_TRNS, SKINNY_ARROW, KC_ASTR, MAP, MAP_FLIPPED, AND, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, DOUBLE_COLON, KC_GRV, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, REVERSE_ARROW, SKINNY_ARROW, CONCAT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + + /* Mouse Level: Mouse Layer + |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| + | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| + | Mouse(Tab) | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backsp | * | + |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| + | Control(Esc) | A | S | D | F | G | Left | Down | Up | Right | Button1 | Button2 | Control(Return) | ****** | * | + |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| + | LShift(() | Z | X | C | V | B | N | M | Button5 | Button4 | Button3 | RShift()) | HHKB | ****** | * | + |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| + + |---------+---------+----------------------------+---------+---------| + | LAlt([) | LGUI({) | ******* Space/Prog ******* | RGUI(}) | RAlt(]) | + |---------+---------+----------------------------+---------+---------| + */ + [MOUSE] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_BTN1, KC_BTN2, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN5, KC_BTN4, KC_BTN3, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/hhkb/keymaps/brett/readme.md b/keyboards/hhkb/keymaps/brett/readme.md new file mode 100644 index 000000000000..fd07b155fb77 --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/readme.md @@ -0,0 +1,13 @@ +# Generated Keymap Layout + +This layout was generated by the QMK API. You can find the JSON data used to +generate this keymap in the file layers.json. + +To make use of this file you will need follow the following steps: + +* Download or Clone QMK Firmware: +* Extract QMK Firmware to a location on your hard drive +* Copy this folder into %s +* You are now ready to compile or use your keymap with the source + +More information can be found in the QMK docs: \ No newline at end of file diff --git a/keyboards/hhkb/keymaps/brett/rules.mk b/keyboards/hhkb/keymaps/brett/rules.mk new file mode 100644 index 000000000000..88f57515f13d --- /dev/null +++ b/keyboards/hhkb/keymaps/brett/rules.mk @@ -0,0 +1,4 @@ +MOUSEKEY_ENABLE = yes +TAP_DANCE_ENABLE = no +LEADER_ENABLE = no +UNICODE_ENABLE = no diff --git a/users/brett/brett.c b/users/brett/brett.c new file mode 100644 index 000000000000..d1ba62729b55 --- /dev/null +++ b/users/brett/brett.c @@ -0,0 +1,109 @@ +#include "brett.h" + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case FAT_ARROW: + if (record->event.pressed) { + SEND_STRING("=>"); + } + return false; + break; + case SKINNY_ARROW: + if (record->event.pressed) { + SEND_STRING("->"); + } + return false; + break; + case REVERSE_ARROW: + if (record->event.pressed) { + SEND_STRING("<-"); + } + return false; + break; + case CONCAT: + if (record->event.pressed) { + SEND_STRING("<>"); + } + return false; + break; + case MAP: + if (record->event.pressed) { + SEND_STRING("<$>"); + } + return false; + break; + case MAP_FLIPPED: + if (record->event.pressed) { + SEND_STRING("<#>"); + } + return false; + break; + case FLAP: + if (record->event.pressed) { + SEND_STRING("<@>"); + } + return false; + break; + case PIPE: + if (record->event.pressed) { + SEND_STRING("|>"); + } + return false; + break; + case ALT: + if (record->event.pressed) { + SEND_STRING("<|>"); + } + return false; + break; + case APPLY: + if (record->event.pressed) { + SEND_STRING("<*>"); + } + return false; + break; + case AND: + if (record->event.pressed) { + SEND_STRING("&&"); + } + return false; + break; + case OR: + if (record->event.pressed) { + SEND_STRING("||"); + } + return false; + break; + case BIND: + if (record->event.pressed) { + SEND_STRING(">>="); + } + return false; + break; + case BIND_FLIPPED: + if (record->event.pressed) { + SEND_STRING("=<<"); + } + return false; + break; + case DOUBLE_COLON: + if (record->event.pressed) { + SEND_STRING("::"); + } + return false; + break; + case VOID_LEFT: + if (record->event.pressed) { + SEND_STRING("<$"); + } + return false; + break; + case VOID_RIGHT: + if (record->event.pressed) { + SEND_STRING("$>"); + } + return false; + break; + } + return true; +} diff --git a/users/brett/brett.h b/users/brett/brett.h new file mode 100644 index 000000000000..5e71dcbea5e1 --- /dev/null +++ b/users/brett/brett.h @@ -0,0 +1,30 @@ +#ifndef USERSPACE +#define USERSPACE + +#include QMK_KEYBOARD_H + +enum userspace_custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // Can always be here + FAT_ARROW, // => + SKINNY_ARROW, // -> + REVERSE_ARROW, // <- + CONCAT, // <> + MAP, // <$> + MAP_FLIPPED, // <#> + FLAP, // <@> + PIPE, // |> + ALT, // <|> + APPLY, // <*> + AND, // && + OR, // || + BIND, // >>= + BIND_FLIPPED, // =<< + VOID_LEFT, // <$ + VOID_RIGHT, // $> + DOUBLE_COLON, // :: + DYNAMIC_MACRO_RANGE // Should always be last +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + +#endif diff --git a/users/brett/rules.mk b/users/brett/rules.mk new file mode 100644 index 000000000000..b186662ddb9a --- /dev/null +++ b/users/brett/rules.mk @@ -0,0 +1 @@ +SRC += brett.c From 3a22428f0fae9c8002b5b80ffe9f8e9931d1533f Mon Sep 17 00:00:00 2001 From: brettm12345 Date: Fri, 7 Feb 2020 02:56:08 -0500 Subject: [PATCH 2/6] Update my keymap --- keyboards/hhkb/keymaps/brett/config.h | 9 ++--- keyboards/hhkb/keymaps/brett/keymap.c | 50 +++++++++++++-------------- users/brett/brett.c | 9 +++++ users/brett/brett.h | 1 + 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/keyboards/hhkb/keymaps/brett/config.h b/keyboards/hhkb/keymaps/brett/config.h index 5c60fd1abc86..be56d9b8c412 100644 --- a/keyboards/hhkb/keymaps/brett/config.h +++ b/keyboards/hhkb/keymaps/brett/config.h @@ -1,7 +1,6 @@ -#ifndef CONFIG_BRETT_H -#define CONFIG_BRETT_H +#pragma once -#include "../../config.h" +#include QMK_KEYBOARD_H // Define mousekey settings #define MOUSEKEY_DELAY 0 @@ -11,12 +10,10 @@ #define MOUSEKEY_WHEEL_DELAY 0 #define LSPO_KEY KC_9 -#define RSPC_KEY KC_9 +#define RSPC_KEY KC_0 #define LSPO_MOD KC_LSHIFT #define RSPC_MOD KC_RSHIFT // This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when // you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT - -#endif diff --git a/keyboards/hhkb/keymaps/brett/keymap.c b/keyboards/hhkb/keymaps/brett/keymap.c index 38acc49c2aea..c2c5e7f5d94e 100644 --- a/keyboards/hhkb/keymaps/brett/keymap.c +++ b/keyboards/hhkb/keymaps/brett/keymap.c @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* HHKB Level: Function Layer |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| - | PWR | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + | Flash | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | |---------+------+------+--------+---------+-------+-----------+---------+---------+---------+----------------+--------+------+--------+-----| | Caps | Calc | Mail | Media | Browser | My PC | Browser | u | i | o | Print | [ | ] | Backsp | * | | | | | Player | Refresh | | Favorites | | | | Screen | | | | | @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |------+------+----------------------+------+------| */ [HHKB] = LAYOUT( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + FLASH, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_CAPS, KC_CALC, KC_MAIL, KC_MSEL, KC_WREF, KC_MYCM, KC_WFAV, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_MPRV, KC_MNXT, KC_FIND, KC_TRNS, KC_TRNS, KC_WBAK, KC_WHOM, KC_WSCH, KC_WFWD, KC_TRNS, KC_TRNS, KC_EXEC, KC_TRNS, KC__VOLUP, KC_VOLD, KC_MUTE, KC_SLCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AGIN, KC_WSCH, KC_TRNS, KC_TRNS, @@ -73,48 +73,48 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Programming Level: Symbols Layer - |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| - | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | - |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| - | Tab/Mouse | => | @ | >>= | =<< | ‖ | <> | <|> | <*> | <@> | |> | <$ | $> | Backsp | * | - |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| - | Esc/Control | -> | * | <$> | <#> | && | Left | Down | Up | Right | :: | ` | Return | ****** | * | - |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| - | LShift | z | x | c | v | b | n | m | <- | -> | <> | Shift | HHKB | ****** | * | - |-------------+----+---+-----+-----+----+------+------+-----+-------+-----+-------+--------+--------+---| + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | Esc | TTY 1 | TTY 2 | TTY 3 | TTY 4 | TTY 5 | TTY 6 | TTY 7 | TTY 8 | TTY 9 | TTY 10 | TTY 11 | TTY 12 | \ | ` | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | Tab/Mouse | => | @ | >>= | =<< | ‖ | <> | <|> | <*> | <@> | |> | <$ | $> | Backsp | * | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | Toggle Mouse | -> | * | <$> | <#> | && | Left | Down | Up | Right | :: | ` | Return | ****** | * | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| + | LShift | z | x | c | v | b | n | m | <- | -> | <> | Shift | HHKB | ****** | * | + |--------------+-------+-------+-------+-------+-------+-------+-------+-------+-------+--------+--------+--------+--------+---| |------+------+----------------------------+------+------| | LAlt | LGUI | ******* Space/Prog ******* | RGUI | RAlt | |------+------+----------------------------+------+------| */ [PROG] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_GESC, LCA(KC_F1), LCA(KC_F2), LCA(KC_F3), LCA(KC_F4), LCA(KC_F5), LCA(KC_F6), LCA(KC_F7), LCA(KC_F8), LCA(KC_F9), LCA(KC_F10), LCA(KC_F11), LCA(KC_F12), KC_TRNS, KC_TRNS, KC_TRNS, FAT_ARROW, KC_AT, BIND, BIND_FLIPPED, OR, CONCAT, ALT, APPLY, FLAP, PIPE, VOID_LEFT, VOID_RIGHT, KC_TRNS, - KC_TRNS, SKINNY_ARROW, KC_ASTR, MAP, MAP_FLIPPED, AND, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, DOUBLE_COLON, KC_GRV, KC_TRNS, + TG(MOUSE), SKINNY_ARROW, KC_ASTR, MAP, MAP_FLIPPED, AND, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, DOUBLE_COLON, KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, REVERSE_ARROW, SKINNY_ARROW, CONCAT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), /* Mouse Level: Mouse Layer - |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| - | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | - |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| - | Mouse(Tab) | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backsp | * | - |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| - | Control(Esc) | A | S | D | F | G | Left | Down | Up | Right | Button1 | Button2 | Control(Return) | ****** | * | - |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| - | LShift(() | Z | X | C | V | B | N | M | Button5 | Button4 | Button3 | RShift()) | HHKB | ****** | * | - |--------------+---+---+---+---+---+------+------+---------+---------+---------+-----------+-----------------+--------+---| + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | Esc | Speed 1 | Speed 2 | Speed 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | Mouse(Tab) | Q | Up | Button3 | Button4 | Button5 | Y | U | Button3 | Button4 | Button5 | [ | ] | Backsp | * | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | Control(Esc) | Left | Down | Right | Button1 | Button2 | SLeft | SDown | SUp | SRight | Button1 | Button2 | Control(Return) | ****** | * | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| + | LShift(() | Z | X | C | V | B | N | M | Button5 | Button4 | Button3 | RShift()) | HHKB | ****** | * | + |--------------+---------+---------+---------+---------+---------+-------+-------+---------+---------+---------+-----------+-----------------+--------+---| |---------+---------+----------------------------+---------+---------| | LAlt([) | LGUI({) | ******* Space/Prog ******* | RGUI(}) | RAlt(]) | |---------+---------+----------------------------+---------+---------| */ [MOUSE] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_MS_U, KC_BTN3, KC_BTN4, KC_BTN5, KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN4, KC_BTN5, KC_TRNS, KC_TRNS, KC_TRNS, + TG(MOUSE), KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, KC_BTN2, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_BTN1, KC_BTN2, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN5, KC_BTN4, KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; diff --git a/users/brett/brett.c b/users/brett/brett.c index d1ba62729b55..b793fe1f6da9 100644 --- a/users/brett/brett.c +++ b/users/brett/brett.c @@ -104,6 +104,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case FLASH: + if (record->event.pressed) { + SEND_STRING("sudo -E make hhkb:brett:dfu"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + reset_keyboard(); + } + return false; + break; } return true; } diff --git a/users/brett/brett.h b/users/brett/brett.h index 5e71dcbea5e1..d6715b6564a3 100644 --- a/users/brett/brett.h +++ b/users/brett/brett.h @@ -22,6 +22,7 @@ enum userspace_custom_keycodes { VOID_LEFT, // <$ VOID_RIGHT, // $> DOUBLE_COLON, // :: + FLASH, // Handle keyboard flashing DYNAMIC_MACRO_RANGE // Should always be last }; From 0f3d2ec23b959e89cee4488d79bf945031852da5 Mon Sep 17 00:00:00 2001 From: brettm12345 Date: Sat, 8 Feb 2020 17:01:36 -0500 Subject: [PATCH 3/6] Improve quality of brett.c --- users/brett/brett.c | 159 +++++++++++++------------------------------- users/brett/brett.h | 10 +-- 2 files changed, 50 insertions(+), 119 deletions(-) diff --git a/users/brett/brett.c b/users/brett/brett.c index b793fe1f6da9..f8ec6e08fce9 100644 --- a/users/brett/brett.c +++ b/users/brett/brett.c @@ -1,118 +1,55 @@ #include "brett.h" bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case FAT_ARROW: - if (record->event.pressed) { - SEND_STRING("=>"); - } - return false; - break; - case SKINNY_ARROW: - if (record->event.pressed) { - SEND_STRING("->"); - } - return false; - break; - case REVERSE_ARROW: - if (record->event.pressed) { - SEND_STRING("<-"); - } - return false; - break; - case CONCAT: - if (record->event.pressed) { - SEND_STRING("<>"); - } - return false; - break; - case MAP: - if (record->event.pressed) { - SEND_STRING("<$>"); - } - return false; - break; - case MAP_FLIPPED: - if (record->event.pressed) { - SEND_STRING("<#>"); - } - return false; - break; - case FLAP: - if (record->event.pressed) { - SEND_STRING("<@>"); - } - return false; - break; - case PIPE: - if (record->event.pressed) { - SEND_STRING("|>"); - } - return false; - break; - case ALT: - if (record->event.pressed) { - SEND_STRING("<|>"); - } - return false; - break; - case APPLY: - if (record->event.pressed) { - SEND_STRING("<*>"); - } - return false; - break; - case AND: - if (record->event.pressed) { - SEND_STRING("&&"); - } - return false; - break; - case OR: - if (record->event.pressed) { - SEND_STRING("||"); - } - return false; - break; - case BIND: - if (record->event.pressed) { - SEND_STRING(">>="); - } - return false; - break; - case BIND_FLIPPED: - if (record->event.pressed) { - SEND_STRING("=<<"); - } - return false; - break; - case DOUBLE_COLON: - if (record->event.pressed) { - SEND_STRING("::"); - } - return false; - break; - case VOID_LEFT: - if (record->event.pressed) { - SEND_STRING("<$"); - } - return false; - break; - case VOID_RIGHT: - if (record->event.pressed) { - SEND_STRING("$>"); - } - return false; - break; - case FLASH: + bool send(const char *str) { if (record->event.pressed) { - SEND_STRING("sudo -E make hhkb:brett:dfu"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); - reset_keyboard(); + send_string(str); } return false; - break; - } - return true; + } + switch (keycode) { + case FAT_ARROW: + return send("=>"); + case SKINNY_ARROW: + return send("->"); + case REVERSE_ARROW: + return send("<-"); + case CONCAT: + return send("<>"); + case MAP: + return send("<$>"); + case MAP_FLIPPED: + return send("<#>"); + case FLAP: + return send("<@>"); + case PIPE: + return send("|>"); + case ALT: + return send("<|>"); + case APPLY: + return send("<*>"); + case AND: + return send("&&"); + case OR: + return send("||"); + case BIND: + return send(">>="); + case BIND_FLIPPED: + return send("=<<"); + case DOUBLE_COLON: + return send("::"); + case VOID_LEFT: + return send("<$"); + case VOID_RIGHT: + return send("$>"); + case FLASH: + if (record->event.pressed) { + SEND_STRING("sudo -E make hhkb:brett:dfu"); + register_code(KC_ENTER); + unregister_code(KC_ENTER); + reset_keyboard(); + } + return false; + } + return true; } diff --git a/users/brett/brett.h b/users/brett/brett.h index d6715b6564a3..a359c5157a72 100644 --- a/users/brett/brett.h +++ b/users/brett/brett.h @@ -1,7 +1,4 @@ -#ifndef USERSPACE -#define USERSPACE - -#include QMK_KEYBOARD_H +#pragma once enum userspace_custom_keycodes { PLACEHOLDER = SAFE_RANGE, // Can always be here @@ -22,10 +19,7 @@ enum userspace_custom_keycodes { VOID_LEFT, // <$ VOID_RIGHT, // $> DOUBLE_COLON, // :: - FLASH, // Handle keyboard flashing - DYNAMIC_MACRO_RANGE // Should always be last + FLASH // Handle keyboard flashing }; bool process_record_keymap(uint16_t keycode, keyrecord_t *record); - -#endif From 80c71c62c90f79dd176b86eae763f3b7a7e17063 Mon Sep 17 00:00:00 2001 From: brettm12345 Date: Sat, 8 Feb 2020 17:35:30 -0500 Subject: [PATCH 4/6] Finish cleaning brett.c --- users/brett/brett.c | 64 +++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/users/brett/brett.c b/users/brett/brett.c index f8ec6e08fce9..c19c8b4a8a07 100644 --- a/users/brett/brett.c +++ b/users/brett/brett.c @@ -1,55 +1,61 @@ #include "brett.h" -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - bool send(const char *str) { - if (record->event.pressed) { - send_string(str); - } - return false; - } +char * get_key(uint16_t keycode) { switch (keycode) { case FAT_ARROW: - return send("=>"); + return "=>"; case SKINNY_ARROW: - return send("->"); + return "->"; case REVERSE_ARROW: - return send("<-"); + return "<-"; case CONCAT: - return send("<>"); + return "<>"; case MAP: - return send("<$>"); + return "<$>"; case MAP_FLIPPED: - return send("<#>"); + return "<#>"; case FLAP: - return send("<@>"); + return "<@>"; case PIPE: - return send("|>"); + return "|>"; case ALT: - return send("<|>"); + return "<|>"; case APPLY: - return send("<*>"); + return "<*>"; case AND: - return send("&&"); + return "&&"; case OR: - return send("||"); + return "||"; case BIND: - return send(">>="); + return ">>="; case BIND_FLIPPED: - return send("=<<"); + return "=<<"; case DOUBLE_COLON: - return send("::"); + return "::"; case VOID_LEFT: - return send("<$"); + return "<$"; case VOID_RIGHT: - return send("$>"); + return "$>"; + default: + return ""; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + bool pressed = record->event.pressed; + switch (keycode) { + case FAT_ARROW ... DOUBLE_COLON: + if (pressed) { + send_string(get_key(keycode)); + } + return false; case FLASH: - if (record->event.pressed) { - SEND_STRING("sudo -E make hhkb:brett:dfu"); - register_code(KC_ENTER); - unregister_code(KC_ENTER); + if (!pressed) { + SEND_STRING("make -j8 --output-sync " QMK_KEYBOARD ":" QMK_KEYMAP ":flash" SS_TAP(X_ENTER)); reset_keyboard(); } return false; + default: + return true; } - return true; } From dc1b025bed04772938129c6d6cab8343a9d1a60a Mon Sep 17 00:00:00 2001 From: brettm12345 Date: Sat, 8 Feb 2020 17:36:23 -0500 Subject: [PATCH 5/6] Remove QMK_FIRMWARE_H --- keyboards/hhkb/keymaps/brett/config.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/keyboards/hhkb/keymaps/brett/config.h b/keyboards/hhkb/keymaps/brett/config.h index be56d9b8c412..b9a61e10a78d 100644 --- a/keyboards/hhkb/keymaps/brett/config.h +++ b/keyboards/hhkb/keymaps/brett/config.h @@ -1,7 +1,5 @@ #pragma once -#include QMK_KEYBOARD_H - // Define mousekey settings #define MOUSEKEY_DELAY 0 #define MOUSEKEY_INTERVAL 20 From 4284c68b29d6e15023cedda190e859573d711feb Mon Sep 17 00:00:00 2001 From: Brett Mandler Date: Mon, 9 Mar 2020 21:09:44 -0400 Subject: [PATCH 6/6] Update keyboards/hhkb/keymaps/brett/keymap.c Co-Authored-By: Ryan --- keyboards/hhkb/keymaps/brett/keymap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/hhkb/keymaps/brett/keymap.c b/keyboards/hhkb/keymaps/brett/keymap.c index c2c5e7f5d94e..1201146b0033 100644 --- a/keyboards/hhkb/keymaps/brett/keymap.c +++ b/keyboards/hhkb/keymaps/brett/keymap.c @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { FLASH, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_CAPS, KC_CALC, KC_MAIL, KC_MSEL, KC_WREF, KC_MYCM, KC_WFAV, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_BSPC, KC_TRNS, KC_MPRV, KC_MNXT, KC_FIND, KC_TRNS, KC_TRNS, KC_WBAK, KC_WHOM, KC_WSCH, KC_WFWD, KC_TRNS, KC_TRNS, KC_EXEC, - KC_TRNS, KC__VOLUP, KC_VOLD, KC_MUTE, KC_SLCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AGIN, KC_WSCH, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_SLCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AGIN, KC_WSCH, KC_TRNS, KC_TRNS, KC_MENU, KC_TRNS, KC_MPLY, KC_TRNS, KC_MENU), @@ -117,4 +117,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; -