From 483ab88489b1c96dc84a484741831417307772bf Mon Sep 17 00:00:00 2001 From: Brett Mandler Date: Tue, 10 Mar 2020 04:52:39 -0400 Subject: [Keymap] Added HHKB Keymap and user config (#8119) * Added my config * Update my keymap * Improve quality of brett.c * Finish cleaning brett.c * Remove QMK_FIRMWARE_H * Update keyboards/hhkb/keymaps/brett/keymap.c Co-Authored-By: Ryan Co-authored-by: Ryan --- users/brett/brett.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ users/brett/brett.h | 25 +++++++++++++++++++++ users/brett/rules.mk | 1 + 3 files changed, 87 insertions(+) create mode 100644 users/brett/brett.c create mode 100644 users/brett/brett.h create mode 100644 users/brett/rules.mk (limited to 'users') diff --git a/users/brett/brett.c b/users/brett/brett.c new file mode 100644 index 0000000000..c19c8b4a8a --- /dev/null +++ b/users/brett/brett.c @@ -0,0 +1,61 @@ +#include "brett.h" + +char * get_key(uint16_t keycode) { + switch (keycode) { + case FAT_ARROW: + return "=>"; + case SKINNY_ARROW: + return "->"; + case REVERSE_ARROW: + return "<-"; + case CONCAT: + return "<>"; + case MAP: + return "<$>"; + case MAP_FLIPPED: + return "<#>"; + case FLAP: + return "<@>"; + case PIPE: + return "|>"; + case ALT: + return "<|>"; + case APPLY: + return "<*>"; + case AND: + return "&&"; + case OR: + return "||"; + case BIND: + return ">>="; + case BIND_FLIPPED: + return "=<<"; + case DOUBLE_COLON: + return "::"; + case VOID_LEFT: + return "<$"; + case VOID_RIGHT: + 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 (!pressed) { + SEND_STRING("make -j8 --output-sync " QMK_KEYBOARD ":" QMK_KEYMAP ":flash" SS_TAP(X_ENTER)); + reset_keyboard(); + } + return false; + default: + return true; + } +} diff --git a/users/brett/brett.h b/users/brett/brett.h new file mode 100644 index 0000000000..a359c5157a --- /dev/null +++ b/users/brett/brett.h @@ -0,0 +1,25 @@ +#pragma once + +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, // :: + FLASH // Handle keyboard flashing +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); diff --git a/users/brett/rules.mk b/users/brett/rules.mk new file mode 100644 index 0000000000..b186662ddb --- /dev/null +++ b/users/brett/rules.mk @@ -0,0 +1 @@ +SRC += brett.c -- cgit v1.2.3