summaryrefslogtreecommitdiff
path: root/keyboards/xiudi/xd004/keymaps
diff options
context:
space:
mode:
authorpeepeetee <43021794+peepeetee@users.noreply.github.com>2021-08-21 22:53:49 -0500
committerGitHub <noreply@github.com>2021-08-22 13:53:49 +1000
commit78ccd9c201199444bc06161b05ee8d7ba9c31613 (patch)
tree726d9e55d8cde510fe72bc1fb9bb2a7dabdbecc2 /keyboards/xiudi/xd004/keymaps
parentc70abc8d047319830e369ae4e14cd43bae3bd3b8 (diff)
Organize KPrepublic, K.T.E.C, xiudi boards into directories (#12159)
* reset; redoing my steps; and recommit * include xd002/.noci
Diffstat (limited to 'keyboards/xiudi/xd004/keymaps')
-rw-r--r--keyboards/xiudi/xd004/keymaps/default/keymap.c13
-rw-r--r--keyboards/xiudi/xd004/keymaps/default/readme.md7
-rw-r--r--keyboards/xiudi/xd004/keymaps/narze/keymap.c24
-rw-r--r--keyboards/xiudi/xd004/keymaps/narze/readme.md13
-rw-r--r--keyboards/xiudi/xd004/keymaps/system_and_media/keymap.c59
-rw-r--r--keyboards/xiudi/xd004/keymaps/system_and_media/readme.md9
6 files changed, 125 insertions, 0 deletions
diff --git a/keyboards/xiudi/xd004/keymaps/default/keymap.c b/keyboards/xiudi/xd004/keymaps/default/keymap.c
new file mode 100644
index 0000000000..e82ce5e973
--- /dev/null
+++ b/keyboards/xiudi/xd004/keymaps/default/keymap.c
@@ -0,0 +1,13 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ // 0: Base Layer
+ LAYOUT_all(KC_L, KC_O, KC_V, KC_E),
+
+};
+
+// Loop
+void matrix_scan_user(void){
+ // Empty
+};
diff --git a/keyboards/xiudi/xd004/keymaps/default/readme.md b/keyboards/xiudi/xd004/keymaps/default/readme.md
new file mode 100644
index 0000000000..fdf07cc877
--- /dev/null
+++ b/keyboards/xiudi/xd004/keymaps/default/readme.md
@@ -0,0 +1,7 @@
+# Default Keymap for XD004 PCB
+
+This keymap is not very useful, but it will validate that the board works.
+
+## Build
+
+To build the default keymap, simply run `make xd004:default`.
diff --git a/keyboards/xiudi/xd004/keymaps/narze/keymap.c b/keyboards/xiudi/xd004/keymaps/narze/keymap.c
new file mode 100644
index 0000000000..30ea48d683
--- /dev/null
+++ b/keyboards/xiudi/xd004/keymaps/narze/keymap.c
@@ -0,0 +1,24 @@
+/* Copyright 2021 narze
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ // 0: Base Layer
+ LAYOUT_all(HYPR(KC_F2), HYPR(KC_F1), LCTL(KC_B), LCTL(KC_X)),
+
+};
diff --git a/keyboards/xiudi/xd004/keymaps/narze/readme.md b/keyboards/xiudi/xd004/keymaps/narze/readme.md
new file mode 100644
index 0000000000..6f4bca9a90
--- /dev/null
+++ b/keyboards/xiudi/xd004/keymaps/narze/readme.md
@@ -0,0 +1,13 @@
+# narze Keymap for XD004 PCB
+
+(Key 1 is on the opposite of USB port side, so I flip the keys to make usb port be on the left)
+
+- Key 1 : Hyper + F2
+- Key 2 : Hyper + F1
+- Key 3 : Ctrl + B (Microphone : Toggle mute)
+- Key 4 : Ctrl + X (Microphone : Push to talk)
+
+## Build & Flash
+
+- Put this board in DFU : bridge the last two pins (#5 & 6) of the 6-pin "J2" header on the opposite edge of the board to the USB port.
+- `make xd004/v1:narze:flash` or `qmk flash -kb xd004/v1 -km narze`
diff --git a/keyboards/xiudi/xd004/keymaps/system_and_media/keymap.c b/keyboards/xiudi/xd004/keymaps/system_and_media/keymap.c
new file mode 100644
index 0000000000..60f0e15bbe
--- /dev/null
+++ b/keyboards/xiudi/xd004/keymaps/system_and_media/keymap.c
@@ -0,0 +1,59 @@
+#include QMK_KEYBOARD_H
+
+#define _BASE 0 // Base layer
+#define _SYSTEM 1 // System actions
+#define _VOLUME 2 // Volume actions
+
+#define SUPER_ALT_F4_TIMER 300 // Timeout on the super alt-f4 key
+
+/*
+ The idea of this is pretty simple: base layer has four action, two of which (the outermost)
+ are regular keystrokes on tap, and a momentary layer switch on hold, sending you to layers 1 and 2.
+
+ The other bit of customization here is the 'Super Alt F4' which does Alt-F4, and then Enter if tapped
+ again SUPER_ALT_F4_TIMER miliseconds after. This lets you Alt-F4 applications, and finally quickly
+ double-tap it to Alt-F4+Enter to shut down the PC.
+*/
+
+bool is_alt_f4_active = false;
+uint16_t alt_f4_timer = 0;
+
+enum custom_keycodes { // Make sure have the awesome keycode ready
+ SUPER_ALT_F4 = SAFE_RANGE,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ // 0: Base Layer
+ [_BASE] = LAYOUT_all(LT(_SYSTEM, KC_F5), C(G(KC_LEFT)), C(G(KC_RIGHT)), LT(_VOLUME, KC_F7)),
+
+ // 1: System actions
+ [_SYSTEM] = LAYOUT_all(_______, SUPER_ALT_F4, G(KC_D), G(KC_L)),
+
+ // 2: Volume actions
+ [_VOLUME] = LAYOUT_all(KC_MEDIA_NEXT_TRACK, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _______),
+
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) { // This will do most of the grunt work with the keycodes.
+ case SUPER_ALT_F4:
+ if (record->event.pressed) {
+ if (!is_alt_f4_active) {
+ is_alt_f4_active = true;
+ tap_code16(LALT(KC_F4)); // Alt-F4
+ } else {
+ tap_code(KC_ENTER); // Tap enter
+ }
+ }
+ alt_f4_timer = timer_read();
+ break;
+ }
+ return true;
+}
+
+void matrix_scan_user(void) {
+ if (is_alt_f4_active && timer_elapsed(alt_f4_timer) > SUPER_ALT_F4_TIMER) {
+ is_alt_f4_active = false;
+ }
+};
diff --git a/keyboards/xiudi/xd004/keymaps/system_and_media/readme.md b/keyboards/xiudi/xd004/keymaps/system_and_media/readme.md
new file mode 100644
index 0000000000..d684d463c6
--- /dev/null
+++ b/keyboards/xiudi/xd004/keymaps/system_and_media/readme.md
@@ -0,0 +1,9 @@
+# Slightly more advanced keymap for XD004 PCB
+
+A somehow more useful keymap, allowing one to move across virtual desktops on Windows, etc.
+
+It also has a 'Super Alt-F4' key for Windows that, when tapped does Alt-F4, unless two consecutive taps are less than 300ms apart, in which case the second tap becomes Enter. This allows you to close all apps doing taps, and then when the System shutdown window arrives you do a second quick tap and it will type enter, thus shutting down the computer.
+
+## Build
+
+To build the keymap, simply run `make xd004:system_and_media`.