aboutsummaryrefslogtreecommitdiffstats
path: root/users/brett/brett.c
diff options
context:
space:
mode:
authorGravatar Brett Mandler <brettmandler@gmail.com>2020-03-10 04:52:39 -0400
committerGravatar GitHub <noreply@github.com>2020-03-10 01:52:39 -0700
commit483ab88489b1c96dc84a484741831417307772bf (patch)
treebb319374d012fa56f864cfde4b8ec5502dca6bd5 /users/brett/brett.c
parentdbbab409812ea7c579760e2973399245c21ff843 (diff)
downloadqmk_firmware-483ab88489b1c96dc84a484741831417307772bf.tar.gz
[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 <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'users/brett/brett.c')
-rw-r--r--users/brett/brett.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/users/brett/brett.c b/users/brett/brett.c
new file mode 100644
index 000000000..c19c8b4a8
--- /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;
+ }
+}