|
|
@ -473,56 +473,105 @@ bool process_record_quantum(keyrecord_t *record) {
|
|
|
|
return process_action_kb(record);
|
|
|
|
return process_action_kb(record);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool shift_us_qwerty[0x80] = {
|
|
|
|
const bool ascii_to_qwerty_shift_lut[0x80] PROGMEM = {
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 31
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, // 32 - 63
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 64 - 95
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0 // 96 - 127
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 1, 1, 1, 1, 1, 1, 0,
|
|
|
|
|
|
|
|
1, 1, 1, 1, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 1, 0, 1, 0, 1, 1,
|
|
|
|
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
|
|
|
|
1, 1, 1, 0, 0, 0, 1, 1,
|
|
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, 1, 1, 1, 1, 0
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
uint8_t ascii_us_qwerty[0x80] = {
|
|
|
|
const uint8_t ascii_to_qwerty_keycode_lut[0x80] PROGMEM = {
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, KC_ESC, 0, 0, 0, 0, // 0 - 31
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, // 32 - 46
|
|
|
|
KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0,
|
|
|
|
KC_SLSH, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, // 47 - 61
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
KC_DOT, KC_SLSH, KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, // 62 - 78
|
|
|
|
0, 0, 0, KC_ESC, 0, 0, 0, 0,
|
|
|
|
KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, // 79 - 94
|
|
|
|
KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT,
|
|
|
|
KC_MINS, KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, // 95 - 111
|
|
|
|
KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH,
|
|
|
|
KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL // 112 - 127
|
|
|
|
KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7,
|
|
|
|
|
|
|
|
KC_8, KC_9, KC_SCLN, KC_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH,
|
|
|
|
|
|
|
|
KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G,
|
|
|
|
|
|
|
|
KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O,
|
|
|
|
|
|
|
|
KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W,
|
|
|
|
|
|
|
|
KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS,
|
|
|
|
|
|
|
|
KC_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G,
|
|
|
|
|
|
|
|
KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O,
|
|
|
|
|
|
|
|
KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W,
|
|
|
|
|
|
|
|
KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// This is how you'd add OS colemak support
|
|
|
|
/* for users whose OSes are set to Colemak */
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
// bool shift_us_colemak[0x80] = {
|
|
|
|
#include "keymap_colemak.h"
|
|
|
|
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 31
|
|
|
|
|
|
|
|
// 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, // 32 - 63
|
|
|
|
const bool ascii_to_colemak_shift_lut[0x80] PROGMEM = {
|
|
|
|
// 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 64 - 95
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0 // 96 - 127
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
// };
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
// #include "keymap_colemak.h"
|
|
|
|
0, 1, 1, 1, 1, 1, 1, 0,
|
|
|
|
|
|
|
|
1, 1, 1, 1, 0, 0, 0, 0,
|
|
|
|
// uint8_t ascii_us_colemak[0x80] = {
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
// 0, 0, 0, 0, 0, 0, 0, 0, KC_BSPC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, KC_ESC, 0, 0, 0, 0, // 0 - 31
|
|
|
|
0, 0, 1, 0, 1, 0, 1, 1,
|
|
|
|
// KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT, KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, // 32 - 46
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
// KC_SLSH, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, CM_SCLN, CM_SCLN, KC_COMM, KC_EQL, // 47 - 61
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
// KC_DOT, KC_SLSH, KC_2, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G, CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, // 62 - 78
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
// CM_O, CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W, CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, // 79 - 94
|
|
|
|
1, 1, 1, 0, 0, 0, 1, 1,
|
|
|
|
// KC_MINS, KC_GRV, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G, CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O, // 95 - 111
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
// CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W, CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL // 112 - 127
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
// };
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, 1, 1, 1, 1, 0
|
|
|
|
void send_string(char str[]) {
|
|
|
|
};
|
|
|
|
for (int i = 0; str[i] != 0; i++) {
|
|
|
|
|
|
|
|
uint8_t keycode = ascii_us_qwerty[str[i]];
|
|
|
|
const uint8_t ascii_to_colemak_keycode_lut[0x80] PROGMEM = {
|
|
|
|
if (shift_us_qwerty[str[i]]) {
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
0, 0, 0, KC_ESC, 0, 0, 0, 0,
|
|
|
|
|
|
|
|
KC_SPC, KC_1, KC_QUOT, KC_3, KC_4, KC_5, KC_7, KC_QUOT,
|
|
|
|
|
|
|
|
KC_9, KC_0, KC_8, KC_EQL, KC_COMM, KC_MINS, KC_DOT, KC_SLSH,
|
|
|
|
|
|
|
|
KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7,
|
|
|
|
|
|
|
|
KC_8, KC_9, CM_SCLN, CM_SCLN, KC_COMM, KC_EQL, KC_DOT, KC_SLSH,
|
|
|
|
|
|
|
|
KC_2, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G,
|
|
|
|
|
|
|
|
CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O,
|
|
|
|
|
|
|
|
CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W,
|
|
|
|
|
|
|
|
CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_6, KC_MINS,
|
|
|
|
|
|
|
|
KC_GRV, CM_A, CM_B, CM_C, CM_D, CM_E, CM_F, CM_G,
|
|
|
|
|
|
|
|
CM_H, CM_I, CM_J, CM_K, CM_L, CM_M, CM_N, CM_O,
|
|
|
|
|
|
|
|
CM_P, CM_Q, CM_R, CM_S, CM_T, CM_U, CM_V, CM_W,
|
|
|
|
|
|
|
|
CM_X, CM_Y, CM_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void send_string(const char *str) {
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
|
|
|
|
uint8_t keycode;
|
|
|
|
|
|
|
|
uint8_t ascii_code = pgm_read_byte(str);
|
|
|
|
|
|
|
|
if (!ascii_code) break;
|
|
|
|
|
|
|
|
keycode = pgm_read_byte(&ascii_to_qwerty_keycode_lut[ascii_code]);
|
|
|
|
|
|
|
|
if (pgm_read_byte(&ascii_to_qwerty_shift_lut[ascii_code])) {
|
|
|
|
register_code(KC_LSFT);
|
|
|
|
register_code(KC_LSFT);
|
|
|
|
register_code(keycode);
|
|
|
|
register_code(keycode);
|
|
|
|
unregister_code(keycode);
|
|
|
|
unregister_code(keycode);
|
|
|
|
unregister_code(KC_LSFT);
|
|
|
|
unregister_code(KC_LSFT);
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
register_code(keycode);
|
|
|
|
register_code(keycode);
|
|
|
|
unregister_code(keycode);
|
|
|
|
unregister_code(keycode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
++str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|