summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h
diff options
context:
space:
mode:
authorNoan Mousy <4sstylz@protonmail.ch>2019-12-13 15:39:10 +0100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-12-13 06:39:10 -0800
commit20d3a979f1999fcc27a47e4f32533fb8e8b633a0 (patch)
tree5e8168cde7773affb1b10254eb9627d17b2eac48 /keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h
parent2d1c985ff44ecfe54fe82021e0326b3c7b07db9f (diff)
Adding Backlight on the handwired AEK64 keyboard (#7629)
* Implementing backlight with breathing * Rework of my personal keymap and adding some macros.
Diffstat (limited to 'keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h')
-rw-r--r--keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h b/keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h
new file mode 100644
index 0000000000..9898fe0df3
--- /dev/null
+++ b/keyboards/handwired/aek64/keymaps/4sstylz/keycodes.h
@@ -0,0 +1,85 @@
+/*
+ * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ * Version 2, December 2004
+ *
+ * Copyright (C) 2019 4sStylZ <4sstylz@protonmail.ch>
+ *
+ * Everyone is permitted to copy and distribute verbatim or modified
+ * copies of this license document, and changing it is allowed as long
+ * as the name is changed.
+ *
+ * DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+ * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+ *
+ * 0. You just DO WHAT THE FUCK YOU WANT TO.
+ */
+#include QMK_KEYBOARD_H
+
+/**
+ * Macro for selecting all the text in the document.
+ * Usual shortcut : Ctrl+A.
+ *
+ * @param keyrecord_t *record
+ *
+ * @return void
+ */
+void select_all(keyrecord_t *record) {
+ if (record->event.pressed) {
+ register_code(KC_LCTL);
+ tap_code(KC_A);
+ unregister_code(KC_LCTL);
+ }
+}
+
+/**
+ * Macro for selecting the current row.
+ *
+ * @param keyrecord_t *record
+ *
+ * @return void
+ */
+void select_row(keyrecord_t *record) {
+ if (record->event.pressed) {
+ tap_code(KC_HOME);
+ register_code(KC_LSFT);
+ tap_code(KC_END);
+ unregister_code(KC_LSFT);
+ }
+}
+
+/**
+ * Macro for selecting the current word.
+ * Usage : You need to have the cursor into the word or directly at the right.
+ *
+ *
+ * Usual shortcut : Ctrl+A.
+ *
+ * @param keyrecord_t *record
+ *
+ * @return void
+ */
+void select_word(keyrecord_t *record) {
+ if (record->event.pressed) {
+ register_code(KC_LCTL);
+ tap_code(KC_LEFT);
+ register_code(KC_LSFT);
+ tap_code(KC_RIGHT);
+ unregister_code(KC_LSFT);
+ unregister_code(KC_LCTL);
+ }
+}
+
+/**
+ * Macro for inserting two 0 with keypad.
+ * Be carefull to have the keypad lock enabled
+ *
+ * @param keyrecord_t *record
+ *
+ * @return void
+ */
+void insert_00(keyrecord_t *record) {
+ if (record->event.pressed) {
+ tap_code(KC_P0);
+ tap_code(KC_P0);
+ }
+}