Skip to content

Commit

Permalink
iOSで辞書式を残しつつ使えない機能を無効に
Browse files Browse the repository at this point in the history
  • Loading branch information
Satoru NAKAYA authored and Satoru NAKAYA committed Jan 14, 2024
1 parent f40c240 commit 398430f
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 7 deletions.
4 changes: 4 additions & 0 deletions keyboards/ble_micro_pro/keymaps/naginata_v15m/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
// 薙刀式
#include "naginata.h"
NGKEYS naginata_keys;
#ifdef OLED_ENABLE
bool update_oled = true;
bool ng_state = false;
#endif
// 薙刀式
#include "twpair_on_jis.h"

Expand Down
59 changes: 53 additions & 6 deletions users/naginata_v15m/naginata_parts.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "naginata.h"
#include "naginata_parts.h"

void ng_null(void) {}

// アルファベット
void ng_send_a(void) { // あ
tap_code(KC_A);
Expand Down Expand Up @@ -1227,8 +1229,19 @@ void ng_edit_tenten(void) { // ……{改行}
#ifndef NG_BMP
ng_send_unicode_string_P(PSTR("……"));
#else
ng_ime_complete();
dic_send_string("nagitete"); // "……"
switch (naginata_config.os) {
case NG_IOS:
register_code(KC_LOPT);
tap_code(KC_SCLN);
tap_code(KC_SCLN);
unregister_code(KC_LOPT);
ng_ime_complete();
break;
default:
ng_ime_complete();
dic_send_string("nagitete"); // "……"
break;
}
#endif
}
void ng_symbol_yokobou(void) { // ――{改行}
Expand All @@ -1240,12 +1253,38 @@ void ng_symbol_yokobou(void) { // ――{改行}
#endif
}
void ng_symbol_question(void) { // ?{改行}
#ifndef NG_BMP
tap_code16(LSFT(KC_SLSH));
ng_ime_complete();
tap_code(KC_ENT);
#else
switch (naginata_config.os) {
case NG_IOS:
tap_code16(LSFT(KC_SLSH));
ng_ime_complete();
break;
default:
tap_code16(LSFT(KC_SLSH));
tap_code(KC_ENT);
break;
}
#endif
}
void ng_symbol_exclaim(void) { // !{改行}
#ifndef NG_BMP
tap_code16(LSFT(KC_1));
ng_ime_complete();
tap_code(KC_ENT);
#else
switch (naginata_config.os) {
case NG_IOS:
tap_code16(LSFT(KC_1));
ng_ime_complete();
break;
default:
tap_code16(LSFT(KC_1));
tap_code(KC_ENT);
break;
}
#endif
}
void ng_symbol_chuuten(void) { // ・
tap_code(KC_SLASH);
Expand All @@ -1254,8 +1293,16 @@ void ng_symbol_slash(void) { // /{改行}
#ifndef NG_BMP
ng_send_unicode_string_P(PSTR("/"));
#else
ng_ime_complete();
dic_send_string("naginame"); // "/"
switch (naginata_config.os) {
case NG_IOS:
tap_code16(LOPT(KC_SLSH));
ng_ime_complete();
break;
default:
ng_ime_complete();
dic_send_string("naginame"); // "/"
break;
}
#endif
}
void ng_symbol_maru(void) { // 〇{改行}
Expand Down
2 changes: 2 additions & 0 deletions users/naginata_v15m/naginata_parts.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#pragma once

void ng_null(void);

// アルファベット
void ng_send_a(void); // あ
void ng_send_b(void);
Expand Down
23 changes: 22 additions & 1 deletion users/naginata_v15m/naginata_v15m.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,17 @@ void ng_end() {
}

void ng_katakana() {
#ifndef NG_BMP
tap_code(KC_F7);
#else
switch (naginata_config.os) {
case NG_IOS:
break;
default:
tap_code(KC_F7);
break;
}
#endif
}

void ng_save() {
Expand All @@ -1268,15 +1278,26 @@ void ng_save() {
tap_code16(LCTL(KC_S));
break;
case NG_MAC_DIC:
case NG_IOS:
tap_code16(LCMD(KC_S));
break;
case NG_IOS:
break;
#endif
}
}

void ng_hiragana() {
#ifndef NG_BMP
tap_code(KC_F6);
#else
switch (naginata_config.os) {
case NG_IOS:
break;
default:
tap_code(KC_F6);
break;
}
#endif
}

void ng_redo() {
Expand Down

0 comments on commit 398430f

Please sign in to comment.