|
|
@ -28,8 +28,9 @@ DIP スイッチは、以下を `rules.mk` に追加することでサポート |
|
|
|
コールバック関数を `<keyboard>.c` に記述することができます: |
|
|
|
コールバック関数を `<keyboard>.c` に記述することができます: |
|
|
|
|
|
|
|
|
|
|
|
```c |
|
|
|
```c |
|
|
|
void dip_switch_update_kb(uint8_t index, bool active) { |
|
|
|
bool dip_switch_update_kb(uint8_t index, bool active) { |
|
|
|
dip_switch_update_user(index, active); |
|
|
|
if !(dip_switch_update_user(index, active)) { return false; } |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
@ -37,7 +38,7 @@ void dip_switch_update_kb(uint8_t index, bool active) { |
|
|
|
あるいは `keymap.c` に記述することもできます: |
|
|
|
あるいは `keymap.c` に記述することもできます: |
|
|
|
|
|
|
|
|
|
|
|
```c |
|
|
|
```c |
|
|
|
void dip_switch_update_user(uint8_t index, bool active) { |
|
|
|
bool dip_switch_update_user(uint8_t index, bool active) { |
|
|
|
switch (index) { |
|
|
|
switch (index) { |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
if(active) { audio_on(); } else { audio_off(); } |
|
|
|
if(active) { audio_on(); } else { audio_off(); } |
|
|
@ -62,6 +63,7 @@ void dip_switch_update_user(uint8_t index, bool active) { |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
@ -69,8 +71,9 @@ void dip_switch_update_user(uint8_t index, bool active) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```c |
|
|
|
```c |
|
|
|
void dip_switch_update_mask_kb(uint32_t state) { |
|
|
|
bool dip_switch_update_mask_kb(uint32_t state) { |
|
|
|
dip_switch_update_mask_user(state); |
|
|
|
if (!dip_switch_update_mask_user(state)) { return false; } |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
@ -78,7 +81,7 @@ void dip_switch_update_mask_kb(uint32_t state) { |
|
|
|
あるいは `keymap.c` に記述することもできます: |
|
|
|
あるいは `keymap.c` に記述することもできます: |
|
|
|
|
|
|
|
|
|
|
|
```c |
|
|
|
```c |
|
|
|
void dip_switch_update_mask_user(uint32_t state) { |
|
|
|
bool dip_switch_update_mask_user(uint32_t state) { |
|
|
|
if (state & (1UL<<0) && state & (1UL<<1)) { |
|
|
|
if (state & (1UL<<0) && state & (1UL<<1)) { |
|
|
|
layer_on(_ADJUST); // C on esc |
|
|
|
layer_on(_ADJUST); // C on esc |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -94,6 +97,7 @@ void dip_switch_update_mask_user(uint32_t state) { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
layer_off(_TEST_B); |
|
|
|
layer_off(_TEST_B); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|