aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/planck/keymaps/rai-suta/Makefile28
-rw-r--r--keyboards/planck/keymaps/rai-suta/config.h8
-rw-r--r--keyboards/planck/keymaps/rai-suta/keymap.c107
-rw-r--r--keyboards/planck/keymaps/rai-suta/readme.md3
-rw-r--r--quantum/quantum.c2
5 files changed, 147 insertions, 1 deletions
diff --git a/keyboards/planck/keymaps/rai-suta/Makefile b/keyboards/planck/keymaps/rai-suta/Makefile
new file mode 100644
index 000000000..4263440ec
--- /dev/null
+++ b/keyboards/planck/keymaps/rai-suta/Makefile
@@ -0,0 +1,28 @@
1
2
3# Build Options
4# change to "no" to disable the options, or define them in the Makefile in
5# the appropriate keymap folder that will get included automatically
6#
7BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
8MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
9EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
10CONSOLE_ENABLE = yes # Console for debug(+400)
11COMMAND_ENABLE = no # Commands for debug and configuration
12NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
13BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
14MIDI_ENABLE = no # MIDI controls
15AUDIO_ENABLE = no # Audio output on port C6
16UNICODE_ENABLE = no # Unicode
17BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
18RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23# Option defines
24OPT_DEFS += -DJIS_KEYCODE
25
26ifndef QUANTUM_DIR
27 include ../../../../Makefile
28endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/rai-suta/config.h b/keyboards/planck/keymaps/rai-suta/config.h
new file mode 100644
index 000000000..b36aa3db9
--- /dev/null
+++ b/keyboards/planck/keymaps/rai-suta/config.h
@@ -0,0 +1,8 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#define TAPPING_TERM ( 200 )
7
8#endif
diff --git a/keyboards/planck/keymaps/rai-suta/keymap.c b/keyboards/planck/keymaps/rai-suta/keymap.c
new file mode 100644
index 000000000..13fc3677e
--- /dev/null
+++ b/keyboards/planck/keymaps/rai-suta/keymap.c
@@ -0,0 +1,107 @@
1// This keymap assumes that the keyboard is recognized as JIS keyboard from the OS.
2
3#include "planck.h"
4#include "version.h"
5
6// Keycode defines
7#define _______ KC_TRNS
8#define XXXXXXX KC_NO
9#define C(kc) LCTL(kc)
10// JIS keyboard
11#define JK_CIRC KC_EQL // ^
12#define JK_AT KC_LBRC // @
13#define JK_LBRC KC_RBRC // [
14#define JK_CLN KC_QUOT // :
15#define JK_RBRC KC_BSLS // ]
16#define JK_BSLS KC_RO // Backslash(\)
17#define JK_DQT S(KC_2) // "
18#define JK_AMPR S(KC_6) // &
19#define JK_SQT S(KC_7) // '
20#define JK_LPRN S(KC_8) // (
21#define JK_RPRN S(KC_9) // )
22#define JK_S0 S(KC_0) // Tilde(~) at IBM 5576-A01 spec
23#define JK_EQ S(KC_MINS) // =
24#define JK_TLD S(JK_CIRC) // ~
25#define JK_PIPE S(KC_JYEN) // |
26#define JK_GRV S(JK_AT) // `
27#define JK_LCBR S(JK_LBRC) // {
28#define JK_PLUS S(KC_SCLN) // +
29#define JK_ASTR S(JK_CLN) // *
30#define JK_RCBR S(JK_RBRC) // }
31#define JK_QUES S(KC_SLSH) // ?
32#define JK_UNDS S(JK_BSLS) // _
33
34enum user_macro {
35 UM_MHEN,
36 UM_HENK,
37 UM_DEBUG,
38};
39#define M_MHEN MACROTAP(UM_MHEN)
40#define M_HENK MACROTAP(UM_HENK)
41#define M_DEBUG M(UM_DEBUG)
42
43enum keymap_layer {
44 KL_QWERTY,
45 KL_LOWER,
46 KL_RAISE,
47};
48const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
49
50 [KL_QWERTY] = {
51 { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
52 {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JK_CLN},
53 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
54 {KC_ZKHK, KC_KANA, KC_LGUI, KC_LALT, M_MHEN, KC_SPC, KC_SPC, M_HENK, KC_RALT, KC_RGUI, KC_APP, KC_ENT}
55 },
56
57 [KL_LOWER] = {
58 {KC_GESC, KC_EXLM, JK_DQT, KC_HASH, KC_DLR, KC_PERC, JK_AMPR, JK_SQT, JK_LPRN, JK_RPRN, JK_S0, KC_DEL},
59 {_______, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC, JK_EQ, JK_TLD, JK_GRV, JK_LCBR, JK_PIPE},
60 {_______, C(KC_Z), C(KC_X), C(KC_C), C(KC_V), C(KC_Y), XXXXXXX, KC_ENT, KC_LABK, KC_RABK, JK_RCBR, JK_UNDS},
61 { RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
62 },
63
64 [KL_RAISE] = {
65 {KC_CAPS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL},
66 {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, JK_CIRC, JK_AT, JK_LBRC, KC_JYEN},
67 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_COMM, KC_DOT, JK_RBRC, JK_BSLS},
68 {M_DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
69 },
70
71};
72
73const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
74{
75 dprintf( "record.\n"
76 " event.pressed = %u\n"
77 " tap.count = %u\n"
78 " tap.interrupted = %u\n"
79 , record->event.pressed
80 , record->tap.count
81 , record->tap.interrupted );
82 dprintf( "id = %u\n", id );
83 dprintf( "opt = %u\n", opt );
84
85 switch(id) {
86
87 case UM_MHEN: {
88 return MACRO_TAP_HOLD_LAYER( record, MACRO(TYPE(KC_MHEN), END), KL_LOWER );
89 } break;
90
91 case UM_HENK: {
92 return MACRO_TAP_HOLD_LAYER( record, MACRO(TYPE(KC_HENK), END), KL_RAISE );
93 } break;
94
95 case UM_DEBUG: {
96 if (record->event.pressed) {
97 debug_enable = !debug_enable;
98 if (debug_enable) {
99 dprint("\nDEBUG: enabled.\n");
100 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
101 }
102 }
103 } break;
104
105 }
106 return MACRO_NONE;
107};
diff --git a/keyboards/planck/keymaps/rai-suta/readme.md b/keyboards/planck/keymaps/rai-suta/readme.md
new file mode 100644
index 000000000..cb73c172a
--- /dev/null
+++ b/keyboards/planck/keymaps/rai-suta/readme.md
@@ -0,0 +1,3 @@
1# rai-suta's Planck Layout
2
3This keymap assumes that the keyboard is recognized as JIS keyboard from the OS.
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 3b5e52ff1..5bb7b04d5 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -530,7 +530,7 @@ void send_string(const char *str) {
530 shift = false; 530 shift = false;
531 } 531 }
532 else { 532 else {
533 int hi = ascii_code>>4 & 0x0f; 533 int hi = ascii_code>>4 & 0x0f,
534 lo = ascii_code & 0x0f; 534 lo = ascii_code & 0x0f;
535 keycode = pgm_read_byte(&ascii_to_keycode_lut[hi][lo]); 535 keycode = pgm_read_byte(&ascii_to_keycode_lut[hi][lo]);
536 shift = !!( pgm_read_word(&ascii_to_shift_lut[hi]) & (0x8000u>>lo) ); 536 shift = !!( pgm_read_word(&ascii_to_shift_lut[hi]) & (0x8000u>>lo) );