Update Programmer Dvorak keymap and add sendstring LUT (#8456)

* Update Programmer Dvorak keymap and add sendstring LUT

* Include quantum.h
This commit is contained in:
Ryan 2020-03-19 05:11:57 +11:00 committed by GitHub
parent 0dff26b550
commit fc4ef6934d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 184 additions and 77 deletions

View File

@ -14,85 +14,112 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef KEYMAP_DVP_H #pragma once
#define KEYMAP_DVP_H
#include "keymap.h" #include "keymap.h"
// Normal characters // clang-format off
#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
#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 *       ;  ,  .  P  Y  F  G  C  R  L  /  @   \  
#define DP_F KC_Y *
#define DP_G KC_U *        A  O  E  U  I  D  H  T  N  S  -         
#define DP_C KC_I *
#define DP_R KC_O *          '  Q  J  K  X  B  M  W  V  Z           
#define DP_L KC_P *
#define DP_SLSH KC_LBRC *                                                     
#define DP_AT KC_RBRC *
#define DP_BSLS KC_BSLS */
// 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
#define DP_A KC_A /* Shifted symbols
#define DP_O KC_S *
#define DP_E KC_D *  ~  %  7  5  3  1  9  0  2  4  6  8  `        
#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 // Row 1
#define DP_J KC_C #define DP_TILD S(DP_DLR) // ~
#define DP_K KC_V #define DP_PERC S(DP_AMPR) // %
#define DP_X KC_B #define DP_7 S(DP_LBRC) // 7
#define DP_B KC_N #define DP_5 S(DP_LCBR) // 5
#define DP_M KC_M #define DP_3 S(DP_RCBR) // 3
#define DP_W KC_COMM #define DP_1 S(DP_LPRN) // 1
#define DP_V KC_DOT #define DP_9 S(DP_EQL) // 9
#define DP_Z KC_SLSH #define DP_0 S(DP_ASTR) // 0
#define DP_2 S(DP_RPRN) // 2
// Shifted characters #define DP_4 S(DP_PLUS) // 4
#define DP_TILD LSFT(DP_DLR) #define DP_6 S(DP_RBRC) // 6
#define DP_PERC LSFT(DP_AMPR) #define DP_8 S(DP_EXLM) // 8
#define DP_7 LSFT(DP_LBRC) #define DP_GRV S(DP_HASH) // `
#define DP_5 LSFT(DP_LCBR) // Row 2
#define DP_3 LSFT(DP_RCBR) #define DP_COLN S(DP_SCLN) // :
#define DP_1 LSFT(DP_LPRN) #define DP_LABK S(DP_COMM) // <
#define DP_9 LSFT(DP_EQL) #define DP_RABK S(DP_DOT) // >
#define DP_0 LSFT(DP_ASTR) #define DP_QUES S(DP_SLSH) // ?
#define DP_2 LSFT(DP_RPRN) #define DP_CIRC S(DP_AT) // ^
#define DP_4 LSFT(DP_PLUS) #define DP_PIPE S(DP_BSLS) // |
#define DP_6 LSFT(DP_RBRC) // Row 3
#define DP_8 LSFT(DP_EXLM) #define DP_UNDS S(DP_MINS) // _
#define DP_GRV LSFT(DP_HASH) // Row 4
#define DP_DQUO S(DP_QUOT) // "
#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)
#endif

View File

@ -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
};