Update JIS keymap and sendstring LUT (#8457)

This commit is contained in:
Ryan 2020-03-20 12:27:52 +11:00 committed by GitHub
parent 1c7c5daad4
commit 5d5ff807c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 120 additions and 46 deletions

View File

@ -20,55 +20,129 @@
* note: This website is written in Japanese.
*/
#ifndef KEYMAP_JP_H
#define KEYMAP_JP_H
#pragma once
#include "keymap.h"
#define JP_ZHTG KC_GRV // hankaku/zenkaku|kanzi
#define JP_YEN KC_INT3 // yen, |
#define JP_CIRC KC_EQL // ^, ~
#define JP_AT KC_LBRC // @, `
#define JP_LBRC KC_RBRC // [, {
#define JP_COLN KC_QUOT // :, *
#define JP_RBRC KC_NUHS // ], }
#define JP_BSLS KC_INT1 // \, _
#define JP_MHEN KC_INT5 // muhenkan
#define JP_HENK KC_INT4 // henkan
#define JP_KANA KC_INT2 // katakana/hiragana|ro-mazi
// clang-format off
#define JP_MKANA KC_LANG1 // kana on MacOSX
#define JP_MEISU KC_LANG2 // eisu on MacOSX
/*
*
* ZH 1  2  3  4  5  6  7  8  9  0  -  ^  ¥    
*
*       Q  W  E  R  T  Y  U  I  O  P  @  [      
*     
*  Eisū  A  S  D  F  G  H  J  K  L  ;  :  ]     
*
*          Z  X  C  V  B  N  M  ,  .  /  \       
*
*              Muhen          Hen KH              
*
*/
// Row 1
#define JP_ZKHK KC_GRV // Zenkaku ↔︎ Hankaku ↔ Kanji (半角 ↔ 全角 ↔ 漢字)
#define JP_1 KC_1 // 1
#define JP_2 KC_2 // 2
#define JP_3 KC_3 // 3
#define JP_4 KC_4 // 4
#define JP_5 KC_5 // 5
#define JP_6 KC_6 // 6
#define JP_7 KC_7 // 7
#define JP_8 KC_8 // 8
#define JP_9 KC_9 // 9
#define JP_0 KC_0 // 0
#define JP_MINS KC_MINS // -
#define JP_CIRC KC_EQL // ^
#define JP_YEN KC_INT3 // ¥
// Row 2
#define JP_Q KC_Q // Q
#define JP_W KC_W // W
#define JP_E KC_E // E
#define JP_R KC_R // R
#define JP_T KC_T // T
#define JP_Y KC_Y // Y
#define JP_U KC_U // U
#define JP_I KC_I // I
#define JP_O KC_O // O
#define JP_P KC_P // P
#define JP_AT KC_LBRC // @
#define JP_LBRC KC_RBRC // [
// Row 3
#define JP_EISU KC_CAPS // Eisū (英数)
#define JP_A KC_A // A
#define JP_S KC_S // S
#define JP_D KC_D // D
#define JP_F KC_F // F
#define JP_G KC_G // G
#define JP_H KC_H // H
#define JP_J KC_J // J
#define JP_K KC_K // K
#define JP_L KC_L // L
#define JP_SCLN KC_SCLN // ;
#define JP_COLN KC_QUOT // :
#define JP_RBRC KC_NUHS // ]
// Row 4
#define JP_Z KC_Z // Z
#define JP_X KC_X // X
#define JP_C KC_C // C
#define JP_V KC_V // V
#define JP_B KC_B // B
#define JP_N KC_N // N
#define JP_M KC_M // M
#define JP_COMM KC_COMM // ,
#define JP_DOT KC_DOT // .
#define JP_SLSH KC_SLSH // /
#define JP_BSLS KC_INT1 // (backslash)
// Row 5
#define JP_MHEN KC_INT5 // Muhenkan (無変換)
#define JP_HENK KC_INT4 // Henkan (変換)
#define JP_KANA KC_INT2 // Katakana ↔ Hiragana ↔ Rōmaji (カタカナ ↔ ひらがな ↔ ローマ字)
// Aliases for shifted symbols
#define JP_DQT LSFT(KC_2) // "
#define JP_AMPR LSFT(KC_6) // &
#define JP_QUOT LSFT(KC_7) // '
#define JP_LPRN LSFT(KC_8) // (
#define JP_RPRN LSFT(KC_9) // )
#define JP_EQL LSFT(KC_MINS) // =
#define JP_TILD LSFT(JP_CIRC) // ~
#define JP_PIPE LSFT(JP_YEN) // |
#define JP_GRV LSFT(JP_AT) // `
#define JP_LCBR LSFT(JP_LBRC) // {
#define JP_PLUS LSFT(KC_SCLN) // +
#define JP_ASTR LSFT(JP_COLN) // *
#define JP_RCBR LSFT(JP_RBRC) // }
#define JP_UNDS LSFT(JP_BSLS) // _
/* Shifted symbols
*
*     !  " │ # │ $ │ % │ & │ ' │ ( │ ) │   │ = │ ~ │ | │   │
*
*                                     `  {      
*     
*  Caps                             +  *  }     
*
*                               <  >  ?  _       
*
*                                                  
*
*/
// Row 1
#define JP_EXLM S(JP_1) // !
#define JP_DQUO S(JP_2) // "
#define JP_HASH S(JP_3) // #
#define JP_DLR S(JP_4) // $
#define JP_PERC S(JP_5) // %
#define JP_AMPR S(JP_6) // &
#define JP_QUOT S(JP_7) // '
#define JP_LPRN S(JP_8) // (
#define JP_RPRN S(JP_9) // )
#define JP_EQL S(JP_MINS) // =
#define JP_TILD S(JP_CIRC) // ~
#define JP_PIPE S(JP_YEN) // |
// Row 2
#define JP_GRV S(JP_AT) // `
#define JP_LCBR S(JP_LBRC) // {
// Row 3
#define JP_CAPS S(JP_EISU) // Caps Lock
#define JP_PLUS S(JP_SCLN) // +
#define JP_ASTR S(JP_COLN) // *
#define JP_RCBR S(JP_RBRC) // }
// Row 4
#define JP_LABK S(JP_COMM) // <
#define JP_RABK S(JP_DOT) // >
#define JP_QUES S(JP_SLSH) // ?
#define JP_UNDS S(JP_BSLS) // _
// These symbols are correspond to US101-layout.
#define JP_MINS KC_MINS // -
#define JP_SCLN KC_SCLN // ;
#define JP_COMM KC_COMM // ,
#define JP_DOT KC_DOT // .
#define JP_SLSH KC_SLSH // /
// shifted
#define JP_EXLM KC_EXLM // !
#define JP_HASH KC_HASH // #
#define JP_DLR KC_DLR // $
#define JP_PERC KC_PERC // %
#define JP_LT KC_LT // <
#define JP_GT KC_GT // >
#define JP_QUES KC_QUES // ?
// DEPRECATED
#define JP_ZHTG JP_ZKHK
#define JP_DQT JP_DQUO
#define JP_LT JP_LABK
#define JP_GT JP_RABK
#endif
#define JP_MEISU KC_LANG2 // Eisū (英数) on macOS
#define JP_MKANA KC_LANG1 // Kana (かな) on macOS

View File

@ -40,7 +40,7 @@ const uint8_t ascii_to_shift_lut[16] PROGMEM = {
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(0, 0, 0, 1, 1, 1, 1, 0)
};
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {