summaryrefslogtreecommitdiff
path: root/quantum/keymap_extras
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-03-19 05:11:57 +1100
committerGitHub <noreply@github.com>2020-03-18 11:11:57 -0700
commitfc4ef6934dc8596882428d11877d065ca6272129 (patch)
treea4c4e2b4d8bdfcf550fac135a314043b88686327 /quantum/keymap_extras
parent0dff26b5509e91f6b6f5a9eed2762513d69ce567 (diff)
downloadqmk_firmware-fc4ef6934dc8596882428d11877d065ca6272129.tar.gz
qmk_firmware-fc4ef6934dc8596882428d11877d065ca6272129.zip
Update Programmer Dvorak keymap and add sendstring LUT (#8456)
* Update Programmer Dvorak keymap and add sendstring LUT * Include quantum.h
Diffstat (limited to 'quantum/keymap_extras')
-rw-r--r--quantum/keymap_extras/keymap_dvp.h181
-rw-r--r--quantum/keymap_extras/sendstring_dvp.h80
2 files changed, 184 insertions, 77 deletions
diff --git a/quantum/keymap_extras/keymap_dvp.h b/quantum/keymap_extras/keymap_dvp.h
index 4b60a67d4d..99c69a4af5 100644
--- a/quantum/keymap_extras/keymap_dvp.h
+++ b/quantum/keymap_extras/keymap_dvp.h
@@ -14,85 +14,112 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef KEYMAP_DVP_H
-#define KEYMAP_DVP_H
+#pragma once
#include "keymap.h"
-// Normal characters
-#define DP_DLR KC_GRV
-#define DP_AMPR KC_1
-#define DP_LBRC KC_2
-#define DP_LCBR KC_3
-#define DP_RCBR KC_4
-#define DP_LPRN KC_5
-#define DP_EQL KC_6
-#define DP_ASTR KC_7
-#define DP_RPRN KC_8
-#define DP_PLUS KC_9
-#define DP_RBRC KC_0
-#define DP_EXLM KC_MINS
-#define DP_HASH KC_EQL
+// clang-format off
-#define DP_SCLN KC_Q
-#define DP_COMM KC_W
-#define DP_DOT KC_E
-#define DP_P KC_R
-#define DP_Y KC_T
-#define DP_F KC_Y
-#define DP_G KC_U
-#define DP_C KC_I
-#define DP_R KC_O
-#define DP_L KC_P
-#define DP_SLSH KC_LBRC
-#define DP_AT KC_RBRC
-#define DP_BSLS KC_BSLS
-
-#define DP_A KC_A
-#define DP_O KC_S
-#define DP_E KC_D
-#define DP_U KC_F
-#define DP_I KC_G
-#define DP_D KC_H
-#define DP_H KC_J
-#define DP_T KC_K
-#define DP_N KC_L
-#define DP_S KC_SCLN
-#define DP_MINS KC_QUOT
-
-#define DP_QUOT KC_Z
-#define DP_Q KC_X
-#define DP_J KC_C
-#define DP_K KC_V
-#define DP_X KC_B
-#define DP_B KC_N
-#define DP_M KC_M
-#define DP_W KC_COMM
-#define DP_V KC_DOT
-#define DP_Z KC_SLSH
-
-// Shifted characters
-#define DP_TILD LSFT(DP_DLR)
-#define DP_PERC LSFT(DP_AMPR)
-#define DP_7 LSFT(DP_LBRC)
-#define DP_5 LSFT(DP_LCBR)
-#define DP_3 LSFT(DP_RCBR)
-#define DP_1 LSFT(DP_LPRN)
-#define DP_9 LSFT(DP_EQL)
-#define DP_0 LSFT(DP_ASTR)
-#define DP_2 LSFT(DP_RPRN)
-#define DP_4 LSFT(DP_PLUS)
-#define DP_6 LSFT(DP_RBRC)
-#define DP_8 LSFT(DP_EXLM)
-#define DP_GRV LSFT(DP_HASH)
-
-#define DP_COLN LSFT(DP_SCLN)
-#define DP_LABK LSFT(DP_COMM)
-#define DP_RABK LSFT(DP_DOT)
-#define DP_QUES LSFT(DP_SLSH)
-#define DP_CIRC LSFT(DP_AT)
-#define DP_PIPE LSFT(DP_BSLS)
-#define DP_UNDS LSFT(DP_MINS)
-#define DP_DQUO LSFT(DP_QUOT)
+/*
+ * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
+ * │ $ │ & │ [ │ { │ } │ ( │ = │ * │ ) │ + │ ] │ ! │ # │       │
+ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
+ * │     │ ; │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ @ │  \  │
+ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
+ * │      │ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │        │
+ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤
+ * │        │ ' │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │          │
+ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
+ * │    │    │    │                        │    │    │    │    │
+ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
+ */
+// Row 1
+#define DP_DLR KC_GRV // $
+#define DP_AMPR KC_1 // &
+#define DP_LBRC KC_2 // [
+#define DP_LCBR KC_3 // {
+#define DP_RCBR KC_4 // }
+#define DP_LPRN KC_5 // (
+#define DP_EQL KC_6 // =
+#define DP_ASTR KC_7 // *
+#define DP_RPRN KC_8 // )
+#define DP_PLUS KC_9 // +
+#define DP_RBRC KC_0 // ]
+#define DP_EXLM KC_MINS // !
+#define DP_HASH KC_EQL // #
+// Row 2
+#define DP_SCLN KC_Q // ;
+#define DP_COMM KC_W // ,
+#define DP_DOT KC_E // .
+#define DP_P KC_R // P
+#define DP_Y KC_T // Y
+#define DP_F KC_Y // F
+#define DP_G KC_U // G
+#define DP_C KC_I // C
+#define DP_R KC_O // R
+#define DP_L KC_P // L
+#define DP_SLSH KC_LBRC // /
+#define DP_AT KC_RBRC // @
+#define DP_BSLS KC_BSLS // (backslash)
+// Row 3
+#define DP_A KC_A // A
+#define DP_O KC_S // O
+#define DP_E KC_D // E
+#define DP_U KC_F // U
+#define DP_I KC_G // I
+#define DP_D KC_H // D
+#define DP_H KC_J // H
+#define DP_T KC_K // T
+#define DP_N KC_L // N
+#define DP_S KC_SCLN // S
+#define DP_MINS KC_QUOT // -
+// Row 4
+#define DP_QUOT KC_Z // '
+#define DP_Q KC_X // Q
+#define DP_J KC_C // J
+#define DP_K KC_V // K
+#define DP_X KC_B // X
+#define DP_B KC_N // B
+#define DP_M KC_M // M
+#define DP_W KC_COMM // W
+#define DP_V KC_DOT // V
+#define DP_Z KC_SLSH // Z
-#endif
+/* Shifted symbols
+ * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
+ * │ ~ │ % │ 7 │ 5 │ 3 │ 1 │ 9 │ 0 │ 2 │ 4 │ 6 │ 8 │ ` │       │
+ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
+ * │     │ : │ < │ > │   │   │   │   │   │   │   │ ? │ ^ │  |  │
+ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
+ * │      │   │   │   │   │   │   │   │   │   │   │ _ │        │
+ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤
+ * │        │ " │   │   │   │   │   │   │   │   │   │          │
+ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
+ * │    │    │    │                        │    │    │    │    │
+ * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
+ */
+// Row 1
+#define DP_TILD S(DP_DLR) // ~
+#define DP_PERC S(DP_AMPR) // %
+#define DP_7 S(DP_LBRC) // 7
+#define DP_5 S(DP_LCBR) // 5
+#define DP_3 S(DP_RCBR) // 3
+#define DP_1 S(DP_LPRN) // 1
+#define DP_9 S(DP_EQL) // 9
+#define DP_0 S(DP_ASTR) // 0
+#define DP_2 S(DP_RPRN) // 2
+#define DP_4 S(DP_PLUS) // 4
+#define DP_6 S(DP_RBRC) // 6
+#define DP_8 S(DP_EXLM) // 8
+#define DP_GRV S(DP_HASH) // `
+// Row 2
+#define DP_COLN S(DP_SCLN) // :
+#define DP_LABK S(DP_COMM) // <
+#define DP_RABK S(DP_DOT) // >
+#define DP_QUES S(DP_SLSH) // ?
+#define DP_CIRC S(DP_AT) // ^
+#define DP_PIPE S(DP_BSLS) // |
+// Row 3
+#define DP_UNDS S(DP_MINS) // _
+// Row 4
+#define DP_DQUO S(DP_QUOT) // "
diff --git a/quantum/keymap_extras/sendstring_dvp.h b/quantum/keymap_extras/sendstring_dvp.h
new file mode 100644
index 0000000000..74b595524d
--- /dev/null
+++ b/quantum/keymap_extras/sendstring_dvp.h
@@ -0,0 +1,80 @@
+/* Copyright 2020
+ *
+ * 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/>.
+ */
+
+// Sendstring lookup tables for Programmer Dvorak layouts
+
+#pragma once
+
+#include "keymap_dvp.h"
+#include "quantum.h"
+
+// clang-format off
+
+const uint8_t ascii_to_shift_lut[16] PROGMEM = {
+ KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
+ KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
+ KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
+ KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
+
+ KCLUT_ENTRY(0, 0, 1, 0, 0, 1, 0, 0),
+ KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
+ KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
+ KCLUT_ENTRY(1, 1, 1, 0, 1, 0, 1, 1),
+ KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1),
+ KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
+ KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
+ KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1),
+ KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
+ KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
+ KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
+ KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 1, 0)
+};
+
+const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
+ // NUL SOH STX ETX EOT ENQ ACK BEL
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ // BS TAB LF VT FF CR SO SI
+ KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ // DLE DC1 DC2 DC3 DC4 NAK SYN ETB
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ // CAN EM SUB ESC FS GS RS US
+ XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+
+ // ! " # $ % & '
+ KC_SPC, DP_EXLM, DP_QUOT, DP_HASH, DP_DLR, DP_AMPR, DP_AMPR, DP_QUOT,
+ // ( ) * + , - . /
+ DP_LPRN, DP_RPRN, DP_ASTR, DP_PLUS, DP_COMM, DP_MINS, DP_DOT, DP_SLSH,
+ // 0 1 2 3 4 5 6 7
+ DP_ASTR, DP_LPRN, DP_RPRN, DP_RCBR, DP_PLUS, DP_LCBR, DP_RBRC, DP_LBRC,
+ // 8 9 : ; < = > ?
+ DP_EXLM, DP_EQL, DP_SCLN, DP_SCLN, DP_COMM, DP_EQL, DP_DOT, DP_SLSH,
+ // @ A B C D E F G
+ DP_AT, DP_A, DP_B, DP_C, DP_D, DP_E, DP_F, DP_G,
+ // H I J K L M N O
+ DP_H, DP_I, DP_J, DP_K, DP_L, DP_M, DP_N, DP_O,
+ // P Q R S T U V W
+ DP_P, DP_Q, DP_R, DP_S, DP_T, DP_U, DP_V, DP_W,
+ // X Y Z [ \ ] ^ _
+ DP_X, DP_Y, DP_Z, DP_LBRC, DP_BSLS, DP_RBRC, DP_AT, DP_MINS,
+ // ` a b c d e f g
+ DP_HASH, DP_A, DP_B, DP_C, DP_D, DP_E, DP_F, DP_G,
+ // h i j k l m n o
+ DP_H, DP_I, DP_J, DP_K, DP_L, DP_M, DP_N, DP_O,
+ // p q r s t u v w
+ DP_P, DP_Q, DP_R, DP_S, DP_T, DP_U, DP_V, DP_W,
+ // x y z { | } ~ DEL
+ DP_X, DP_Y, DP_Z, DP_LCBR, DP_BSLS, DP_RCBR, DP_DLR, KC_DEL
+};