diff options
Diffstat (limited to 'docs/ja/feature_dip_switch.md')
-rw-r--r-- | docs/ja/feature_dip_switch.md | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/docs/ja/feature_dip_switch.md b/docs/ja/feature_dip_switch.md index a0f6aeb00..a5436779f 100644 --- a/docs/ja/feature_dip_switch.md +++ b/docs/ja/feature_dip_switch.md | |||
@@ -28,8 +28,9 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート | |||
28 | コールバック関数を `<keyboard>.c` に記述することができます: | 28 | コールバック関数を `<keyboard>.c` に記述することができます: |
29 | 29 | ||
30 | ```c | 30 | ```c |
31 | void dip_switch_update_kb(uint8_t index, bool active) { | 31 | bool dip_switch_update_kb(uint8_t index, bool active) { |
32 | dip_switch_update_user(index, active); | 32 | if !(dip_switch_update_user(index, active)) { return false; } |
33 | return true; | ||
33 | } | 34 | } |
34 | ``` | 35 | ``` |
35 | 36 | ||
@@ -37,7 +38,7 @@ void dip_switch_update_kb(uint8_t index, bool active) { | |||
37 | あるいは `keymap.c` に記述することもできます: | 38 | あるいは `keymap.c` に記述することもできます: |
38 | 39 | ||
39 | ```c | 40 | ```c |
40 | void dip_switch_update_user(uint8_t index, bool active) { | 41 | bool dip_switch_update_user(uint8_t index, bool active) { |
41 | switch (index) { | 42 | switch (index) { |
42 | case 0: | 43 | case 0: |
43 | if(active) { audio_on(); } else { audio_off(); } | 44 | if(active) { audio_on(); } else { audio_off(); } |
@@ -62,6 +63,7 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
62 | } | 63 | } |
63 | break; | 64 | break; |
64 | } | 65 | } |
66 | return true; | ||
65 | } | 67 | } |
66 | ``` | 68 | ``` |
67 | 69 | ||
@@ -69,8 +71,9 @@ void dip_switch_update_user(uint8_t index, bool active) { | |||
69 | 71 | ||
70 | 72 | ||
71 | ```c | 73 | ```c |
72 | void dip_switch_update_mask_kb(uint32_t state) { | 74 | bool dip_switch_update_mask_kb(uint32_t state) { |
73 | dip_switch_update_mask_user(state); | 75 | if (!dip_switch_update_mask_user(state)) { return false; } |
76 | return true; | ||
74 | } | 77 | } |
75 | ``` | 78 | ``` |
76 | 79 | ||
@@ -78,7 +81,7 @@ void dip_switch_update_mask_kb(uint32_t state) { | |||
78 | あるいは `keymap.c` に記述することもできます: | 81 | あるいは `keymap.c` に記述することもできます: |
79 | 82 | ||
80 | ```c | 83 | ```c |
81 | void dip_switch_update_mask_user(uint32_t state) { | 84 | bool dip_switch_update_mask_user(uint32_t state) { |
82 | if (state & (1UL<<0) && state & (1UL<<1)) { | 85 | if (state & (1UL<<0) && state & (1UL<<1)) { |
83 | layer_on(_ADJUST); // C on esc | 86 | layer_on(_ADJUST); // C on esc |
84 | } else { | 87 | } else { |
@@ -94,6 +97,7 @@ void dip_switch_update_mask_user(uint32_t state) { | |||
94 | } else { | 97 | } else { |
95 | layer_off(_TEST_B); | 98 | layer_off(_TEST_B); |
96 | } | 99 | } |
100 | return true; | ||
97 | } | 101 | } |
98 | ``` | 102 | ``` |
99 | 103 | ||