7 bool enable_kc_lang; // for macOS
10 static edvorakjp_config_t edvorakjp_config;
15 static edvorakjp_state_t edvorakjp_state;
20 uint8_t eeconfig_read_edvorakjp(void) {
21 return eeprom_read_byte(EECONFIG_EDVORAK);
24 void eeconfig_update_edvorakjp(uint8_t val) {
25 eeprom_update_byte(EECONFIG_EDVORAK, val);
31 void edvorakjp_status_init(void) {
32 edvorakjp_state.japanese_mode = false;
33 edvorakjp_config.raw = eeconfig_read_edvorakjp();
36 bool get_enable_kc_lang(void) {
37 return edvorakjp_config.enable_kc_lang;
40 void set_enable_kc_lang(bool new_state) {
41 edvorakjp_config.enable_kc_lang = new_state;
42 eeconfig_update_edvorakjp(edvorakjp_config.raw);
45 bool get_japanese_mode(void) {
46 return edvorakjp_state.japanese_mode;
49 void set_japanese_mode(bool new_state) {
50 edvorakjp_state.japanese_mode = new_state;
51 if (edvorakjp_state.japanese_mode) {
52 if (edvorakjp_config.enable_kc_lang) {
53 SEND_STRING(SS_TAP(X_LANG1));
55 SEND_STRING(SS_LALT("`"));
58 if (edvorakjp_config.enable_kc_lang) {
59 SEND_STRING(SS_TAP(X_LANG2));
61 SEND_STRING(SS_LALT("`"));