Add Romanian keymap and sendstring LUT (#8852)

This commit is contained in:
Ryan 2020-04-28 16:23:48 +10:00 committed by GitHub
parent 0d6614f71f
commit aaeef7a833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 290 additions and 0 deletions

View File

@ -0,0 +1,188 @@
/* 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/>.
*/
#pragma once
#include "keymap.h"
// clang-format off
/*
*
*    1  2  3  4  5  6  7  8  9  0  -  =        
*
*       Q  W  E  R  T  Y  U  I  O  P  Ă  Î      
*     
*        A  S  D  F  G  H  J  K  L  Ș  Ț  Â     
*
*      \  Z  X  C  V  B  N  M  ,  .  /           
*
*                                                     
*
*/
// Row 1
#define RO_DLQU KC_GRV // „
#define RO_1 KC_1 // 1
#define RO_2 KC_2 // 2
#define RO_3 KC_3 // 3
#define RO_4 KC_4 // 4
#define RO_5 KC_5 // 5
#define RO_6 KC_6 // 6
#define RO_7 KC_7 // 7
#define RO_8 KC_8 // 8
#define RO_9 KC_9 // 9
#define RO_0 KC_0 // 0
#define RO_MINS KC_MINS // -
#define RO_EQL KC_EQL // =
// Row 2
#define RO_Q KC_Q // Q
#define RO_W KC_W // W
#define RO_E KC_E // E
#define RO_R KC_R // R
#define RO_T KC_T // T
#define RO_Y KC_Y // Y
#define RO_U KC_U // U
#define RO_I KC_I // I
#define RO_O KC_O // O
#define RO_P KC_P // P
#define RO_ABRV KC_LBRC // Ă
#define RO_ICIR KC_RBRC // Î
// Row 3
#define RO_A KC_A // A
#define RO_S KC_S // S
#define RO_D KC_D // D
#define RO_F KC_F // F
#define RO_G KC_G // G
#define RO_H KC_H // H
#define RO_J KC_J // J
#define RO_K KC_K // K
#define RO_L KC_L // L
#define RO_SCOM KC_SCLN // Ș
#define RO_TCOM KC_QUOT // Ț
#define RO_ACIR KC_NUHS // Â
// Row 4
#define RO_BSLS KC_NUBS // (backslash)
#define RO_Z KC_Z // Z
#define RO_X KC_X // X
#define RO_C KC_C // C
#define RO_V KC_V // V
#define RO_B KC_B // B
#define RO_N KC_N // N
#define RO_M KC_M // M
#define RO_COMM KC_COMM // ,
#define RO_DOT KC_DOT // .
#define RO_SLSH KC_SLSH // /
/* Shifted symbols
*
*    !  @  #  $  %  ^  &  *  (  )  _  +        
*
*                                               
*     
*                                               
*
*      |                       ;  :  ?           
*
*                                                     
*
*/
// Row 1
#define RO_RDQU S(RO_DLQU) // ”
#define RO_EXLM S(RO_1) // !
#define RO_AT S(RO_2) // @
#define RO_HASH S(RO_3) // #
#define RO_DLR S(RO_4) // $
#define RO_PERC S(RO_5) // %
#define RO_CIRC S(RO_6) // ^
#define RO_AMPR S(RO_7) // &
#define RO_ASTR S(RO_8) // *
#define RO_LPRN S(RO_9) // (
#define RO_RPRN S(RO_0) // )
#define RO_UNDS S(RO_MINS) // _
#define RO_PLUS S(RO_EQL) // +
// Row 4
#define RO_PIPE S(RO_BSLS) // |
#define RO_SCLN S(RO_COMM) // ;
#define RO_COLN S(RO_DOT) // :
#define RO_QUES S(RO_SLSH) // ?
/* AltGr symbols
*
*  `  ~  ˇ  ^  ˘  °  ˛  `  ˙  ´  ˝  ¨  ¸        
*
*                                 §  [  ]      
*     
*           ß  Đ                 Ł     '        
*
*               ©              <  >              
*
*                                                     
*
*/
// Row 1
#define RO_GRV ALGR(RO_DLQU) // `
#define RO_DTIL ALGR(RO_1) // ~ (dead)
#define RO_CARN ALGR(RO_2) // ˇ (dead)
#define RO_DCIR ALGR(RO_3) // ^ (dead)
#define RO_BREV ALGR(RO_4) // ˘ (dead)
#define RO_RNGA ALGR(RO_5) // ° (dead)
#define RO_OGON ALGR(RO_6) // ˛ (dead)
#define RO_DGRV ALGR(RO_7) // ` (dead)
#define RO_DOTA ALGR(RO_8) // ˙ (dead)
#define RO_ACUT ALGR(RO_9) // ´ (dead)
#define RO_DACU ALGR(RO_0) // ˝ (dead)
#define RO_DIAE ALGR(RO_MINS) // ¨ (dead)
#define RO_CEDL ALGR(RO_EQL) // ¸ (dead)
// Row 2
#define RO_EURO ALGR(RO_E) // €
#define RO_SECT ALGR(RO_P) // §
#define RO_LBRC ALGR(RO_ABRV) // [
#define RO_RBRC ALGR(RO_ICIR) // ]
// Row 3
#define RO_SS ALGR(RO_S) // ß
#define RO_DSTR ALGR(RO_D) // Đ
#define RO_LSTR ALGR(RO_L) // Ł
#define RO_QUOT ALGR(RO_TCOM) // '
// Row 4
#define RO_COPY ALGR(RO_C) // ©
#define RO_LABK ALGR(RO_COMM) // <
#define RO_RABK ALGR(RO_DOT) // >
/* Shift+AltGr symbols
*
*  ~                                  ±        
*
*                                     {  }      
*     
*                                      " │   │    │
*
*                              «  »              
*
*                                                     
*
*/
// Row 1
#define RO_TILD S(ALGR(RO_DLQU)) // ~
#define RO_NDSH S(ALGR(RO_MINS)) //
#define RO_PLMN S(ALGR(RO_EQL)) // ±
// Row 2
#define RO_LCBR S(ALGR(RO_ABRV)) // {
#define RO_RCBR S(ALGR(RO_ICIR)) // }
// Row 3
#define RO_DQUO S(ALGR(RO_TCOM)) // "
// Row 4
#define RO_LDAQ S(ALGR(RO_COMM)) // «
#define RO_RDAQ S(ALGR(RO_DOT)) // »

View File

@ -18,6 +18,8 @@
#include "keymap.h"
// clang-format off
/*
*
*  º  1  2  3  4  5  6  7  8  9  0  '  ¡        

View File

@ -0,0 +1,100 @@
/* 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 Romanian layouts
#pragma once
#include "keymap_romanian.h"
#include "quantum"
// 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, 1, 1, 1, 1, 1, 1, 0),
KCLUT_ENTRY(1, 1, 1, 1, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 1, 1, 0, 0, 0, 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, 1, 1, 1, 1, 1),
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1),
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, 1, 0, 1, 1, 0)
};
const uint8_t ascii_to_altgr_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, 0, 0, 1),
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),
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(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, 1, 0, 1, 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, RO_1, RO_TCOM, RO_3, RO_4, RO_5, RO_7, RO_TCOM,
// ( ) * + , - . /
RO_9, RO_0, RO_8, RO_EQL, RO_COMM, RO_MINS, RO_DOT, RO_SLSH,
// 0 1 2 3 4 5 6 7
RO_0, RO_1, RO_2, RO_3, RO_4, RO_5, RO_6, RO_7,
// 8 9 : ; < = > ?
RO_8, RO_9, RO_DOT, RO_COMM, RO_COMM, RO_EQL, RO_DOT, RO_SLSH,
// @ A B C D E F G
RO_2, RO_A, RO_B, RO_C, RO_D, RO_E, RO_F, RO_G,
// H I J K L M N O
RO_H, RO_I, RO_J, RO_K, RO_L, RO_M, RO_N, RO_O,
// P Q R S T U V W
RO_P, RO_Q, RO_R, RO_S, RO_T, RO_U, RO_V, RO_W,
// X Y Z [ \ ] ^ _
RO_X, RO_Y, RO_Z, RO_ABRV, RO_BSLS, RO_ICIR, RO_6, RO_MINS,
// ` a b c d e f g
RO_DLQU, RO_A, RO_B, RO_C, RO_D, RO_E, RO_F, RO_G,
// h i j k l m n o
RO_H, RO_I, RO_J, RO_K, RO_L, RO_M, RO_N, RO_O,
// p q r s t u v w
RO_P, RO_Q, RO_R, RO_S, RO_T, RO_U, RO_V, RO_W,
// x y z { | } ~ DEL
RO_X, RO_Y, RO_Z, RO_ABRV, RO_BSLS, RO_ICIR, RO_DLQU, KC_DEL
};