Update Hungarian keymap and add sendstring LUT (#8220)

This commit is contained in:
Ryan 2020-03-03 11:55:42 +11:00 committed by GitHub
parent bff56aa46c
commit 53ac4d214f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 267 additions and 113 deletions

View file

@ -14,117 +14,154 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYMAP_HUNGARIAN
#define KEYMAP_HUNGARIAN
#pragma once
#include "keymap.h"
// basic letters
#define HU_Z KC_Y
#define HU_Y KC_Z
#define HU_A KC_A
#define HU_B KC_B
#define HU_C KC_C
#define HU_D KC_D
#define HU_E KC_E
#define HU_F KC_F
#define HU_G KC_G
#define HU_H KC_H
#define HU_I KC_I
#define HU_J KC_J
#define HU_K KC_K
#define HU_L KC_L
#define HU_M KC_M
#define HU_N KC_N
#define HU_O KC_O
#define HU_P KC_P
#define HU_Q KC_Q
#define HU_R KC_R
#define HU_S KC_S
#define HU_T KC_T
#define HU_U KC_U
#define HU_V KC_V
#define HU_W KC_W
#define HU_X KC_X
// num row
#define HU_0 KC_GRV
#define HU_1 KC_1
#define HU_2 KC_2
#define HU_3 KC_3
#define HU_4 KC_4
#define HU_5 KC_5
#define HU_6 KC_6
#define HU_7 KC_7
#define HU_8 KC_8
#define HU_9 KC_9
#define HU_OE KC_0
#define HU_UE KC_MINS
#define HU_OO KC_EQL
// q row
#define HU_OEE KC_LBRC
#define HU_UU KC_RBRC
// a row
#define HU_EE KC_SCLN
#define HU_AA KC_QUOT
#define HU_UEE KC_NUHS
// clang-format off
/*
*
*  0  1  2  3  4  5  6  7  8  9  Ö  Ü  Ó        
*
*       Q  W  E  R  T  Z  U  I  O  P  Ő  Ú      
*     
*        A  S  D  F  G  H  J  K  L  É  Á  Ű     
*
*      Í  Y  X  C  V  B  N  M  ,  .  -           
*
*                                                     
*
*/
// Row 1
#define HU_0 KC_GRV // 0
#define HU_1 KC_1 // 1
#define HU_2 KC_2 // 2
#define HU_3 KC_3 // 3
#define HU_4 KC_4 // 4
#define HU_5 KC_5 // 5
#define HU_6 KC_6 // 6
#define HU_7 KC_7 // 7
#define HU_8 KC_8 // 8
#define HU_9 KC_9 // 9
#define HU_ODIA KC_0 // Ö
#define HU_UDIA KC_MINS // Ü
#define HU_OACU KC_EQL // Ó
// Row 2
#define HU_Q KC_Q // Q
#define HU_W KC_W // W
#define HU_E KC_E // E
#define HU_R KC_R // R
#define HU_T KC_T // T
#define HU_Z KC_Y // Z
#define HU_U KC_U // U
#define HU_I KC_I // I
#define HU_O KC_O // O
#define HU_P KC_P // P
#define HU_ODAC KC_LBRC // Ő
#define HU_UACU KC_RBRC // Ú
// Row 3
#define HU_A KC_A // A
#define HU_S KC_S // S
#define HU_D KC_D // D
#define HU_F KC_F // F
#define HU_G KC_G // G
#define HU_H KC_H // H
#define HU_J KC_J // J
#define HU_K KC_K // K
#define HU_L KC_L // L
#define HU_EACU KC_SCLN // É
#define HU_AACU KC_QUOT // Á
#define HU_UDAC KC_NUHS // Ű
// Row 4
#define HU_IACU KC_NUBS // Í
#define HU_Y KC_Z // Y
#define HU_X KC_X // X
#define HU_C KC_C // C
#define HU_V KC_V // V
#define HU_B KC_B // B
#define HU_N KC_N // N
#define HU_M KC_M // M
#define HU_COMM KC_COMM // ,
#define HU_DOT KC_DOT // .
#define HU_MINS KC_SLSH // -
#define HU_DOT KC_DOT
#define HU_COMM KC_COMM
/* Shifted symbols
*
*  §  '  " │ + │ ! │ % │ / │ = │ ( │ ) │   │   │   │       │
*
*                                               
*     
*                                               
*
*                              ?  :  _           
*
*                                                     
*
*/
// Row 1
#define HU_SECT S(HU_0) // §
#define HU_QUOT S(HU_1) // '
#define HU_DQUO S(HU_2) // "
#define HU_PLUS S(HU_3) // +
#define HU_EXLM S(HU_4) // !
#define HU_PERC S(HU_5) // %
#define HU_SLSH S(HU_6) // /
#define HU_EQL S(HU_7) // =
#define HU_LPRN S(HU_8) // (
#define HU_RPRN S(HU_9) // )
// Row 4
#define HU_QUES S(HU_COMM) // ?
#define HU_COLN S(HU_DOT) // :
#define HU_UNDS S(HU_MINS) // _
// shifted characters
// num row
#define HU_PARA LSFT(HU_0) // §
#define HU_QUOT LSFT(HU_1) // '
#define HU_DQOT LSFT(HU_2) // "
#define HU_PLUS LSFT(HU_3) // +
#define HU_EXLM LSFT(HU_4) // !
#define HU_PERC LSFT(HU_5) // %
#define HU_SLSH LSFT(HU_6) // /
#define HU_EQL LSFT(HU_7) // =
#define HU_LPRN LSFT(HU_8) // (
#define HU_RPRN LSFT(HU_9) // )
// í,y row
#define HU_II KC_NUBS
#define HU_QST LSFT(HU_COMM) // ?
#define HU_COLN LSFT(HU_DOT) // :
#define HU_UNDS LSFT(HU_MINS) // _
// Alt Gr'd characters
// num row
/* AltGr symbols
*
*     ~  ˇ  ^  ˘  °  ˛  `  ˙  ´  ˝  ¨  ¸        
*
*       \  |  Ä                      ÷  ×      
*     
*        ä  đ  Đ  [  ]        ł  Ł  $  ß  ¤     
*
*      <  >  #  &  @  {  }     ;     *           
*
*                                                     
*
*/
// Row 1
#define HU_TILD ALGR(HU_1) // ~
//#define HU_?? ALGR(HU_2) // ˇ (proper name?)
#define HU_CIRC ALGR(HU_3) // ^
#define HU_BRV ALGR(HU_4) // ˘
#define HU_RING ALGR(HU_5) // °
//#define HU_?? ALGR(HU_6) // ˛ (proper name?)
#define HU_CARN ALGR(HU_2) // ˇ (dead)
#define HU_CIRC ALGR(HU_3) // ^ (dead)
#define HU_BREV ALGR(HU_4) // ˘ (dead)
#define HU_RNGA ALGR(HU_5) // ° (dead)
#define HU_OGON ALGR(HU_6) // ˛ (dead)
#define HU_GRV ALGR(HU_7) // `
//#define HU_?? ALGR(HU_8) // ˙ (proper name?)
#define HU_ACUT ALGR(HU_9) // ´
// q row
#define HU_BSLS ALGR(HU_Q) // \ backslash
#define HU_DOTA ALGR(HU_8) // ˙ (dead)
#define HU_ACUT ALGR(HU_9) // ´ (dead)
#define HU_DACU ALGR(HU_ODIA) // ˝ (dead)
#define HU_DIAE ALGR(HU_UDIA) // ¨ (dead)
#define HU_CEDL ALGR(HU_OACU) // ¸ (dead)
// Row 2
#define HU_BSLS ALGR(HU_Q) // (backslash)
#define HU_PIPE ALGR(HU_W) // |
#define HU_DIV ALGR(HU_OEE) // ÷
#define HU_CRSS ALGR(HU_UU) // ×
#define HU_CADI ALGR(HU_E) // Ä
#define HU_EURO ALGR(HU_U) // €
// a row
#define HU_DIV ALGR(HU_ODAC) // ÷
#define HU_MUL ALGR(HU_UACU) // ×
// Row 3
#define HU_LADI ALGR(HU_A) // ä
#define HU_LDST ALGR(HU_S) // đ
#define HU_CDST ALGR(HU_D) // Đ
#define HU_LBRC ALGR(HU_F) // [
#define HU_RBRC ALGR(HU_G) // ]
#define HU_DLR ALGR(HU_EE) // $
#define HU_SS ALGR(HU_AA) // ß
// í,y row
#define HU_LESS ALGR(KC_NUBS) // <
#define HU_MORE ALGR(HU_Y) // >
#define HU_LLST ALGR(HU_K) // ł
#define HU_CLST ALGR(HU_L) // Ł
#define HU_DLR ALGR(HU_EACU) // $
#define HU_SS ALGR(HU_AACU) // ß
#define HU_CURR ALGR(HU_UDAC) // ¤
// Row 4
#define HU_LABK ALGR(HU_IACU) // <
#define HU_RABK ALGR(HU_Y) // >
#define HU_HASH ALGR(HU_X) // #
#define HU_AMPR ALGR(HU_C) // &
#define HU_AT ALGR(HU_V) // @
@ -133,4 +170,21 @@
#define HU_SCLN ALGR(HU_COMM) // ;
#define HU_ASTR ALGR(HU_MINS) // *
#endif
// DEPRECATED
#define HU_OE HU_ODIA
#define HU_UE HU_UDIA
#define HU_OO HU_OACU
#define HU_OEE HU_ODAC
#define HU_UU HU_UACU
#define HU_EE HU_EACU
#define HU_AA HU_AACU
#define HU_UEE HU_UDAC
#define HU_II HU_IACU
#define HU_PARA HU_SECT
#define HU_DQOT HU_DQUO
#define HU_QST HU_QUES
#define HU_BRV HU_BREV
#define HU_RING HU_RNGA
#define HU_CRSS HU_MUL
#define HU_LESS HU_LABK
#define HU_MORE HU_RABK

View file

@ -0,0 +1,100 @@
/* Copyright 2019
*
* 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 Hungarian layouts
#pragma once
#include "keymap_hungarian.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, 1, 1, 0, 0, 1, 0, 1),
KCLUT_ENTRY(1, 1, 0, 1, 0, 0, 0, 1),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 1, 0, 0, 1, 0, 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, 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, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 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, 0, 1, 1, 0, 1, 0),
KCLUT_ENTRY(0, 0, 1, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
KCLUT_ENTRY(0, 0, 0, 1, 1, 0, 1, 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, 1, 1, 1, 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, 1, 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, HU_4, HU_2, HU_X, HU_EACU, HU_5, HU_C, HU_1,
// ( ) * + , - . /
HU_8, HU_9, HU_MINS, HU_3, HU_COMM, HU_MINS, HU_DOT, HU_6,
// 0 1 2 3 4 5 6 7
HU_0, HU_1, HU_2, HU_3, HU_4, HU_5, HU_6, HU_7,
// 8 9 : ; < = > ?
HU_8, HU_9, HU_DOT, HU_COMM, HU_M, HU_7, HU_DOT, HU_COMM,
// @ A B C D E F G
HU_V, HU_A, HU_B, HU_C, HU_D, HU_E, HU_F, HU_G,
// H I J K L M N O
HU_H, HU_I, HU_J, HU_K, HU_L, HU_M, HU_N, HU_O,
// P Q R S T U V W
HU_P, HU_Q, HU_R, HU_S, HU_T, HU_U, HU_V, HU_W,
// X Y Z [ \ ] ^ _
HU_X, HU_Y, HU_Z, HU_F, HU_Q, HU_G, HU_3, HU_MINS,
// ` a b c d e f g
HU_7, HU_A, HU_B, HU_C, HU_D, HU_E, HU_F, HU_G,
// h i j k l m n o
HU_H, HU_I, HU_J, HU_K, HU_L, HU_M, HU_N, HU_O,
// p q r s t u v w
HU_P, HU_Q, HU_R, HU_S, HU_T, HU_U, HU_V, HU_W,
// x y z { | } ~ DEL
HU_X, HU_Y, HU_Z, HU_B, HU_W, HU_N, HU_1, KC_DEL
};