Skip to content

Commit

Permalink
Remove deprecated callbacks for encoders and dip switches (qmk#13404)
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna authored Jul 24, 2021
1 parent 8efa8a3 commit b703378
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions docs/ja/feature_encoders.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,18 @@ ENCODER_ENABLE = yes
コールバック関数を `<keyboard>.c` に記述することができます:

```c
void encoder_update_kb(uint8_t index, bool clockwise) {
encoder_update_user(index, clockwise);
bool encoder_update_kb(uint8_t index, bool clockwise) {
if (!encoder_update_user(index, clockwise)) {
return false;
}

}
```
あるいは `keymap.c` に記述することもできます:
```c
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_PGDN);
Expand All @@ -73,6 +76,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code(KC_UP);
}
}
return true;
}
```

Expand Down
3 changes: 2 additions & 1 deletion layouts/community/ortho_4x12/drashna/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
#endif // ENCODER_ENABLE

#ifdef KEYBOARD_planck_rev6
void dip_update(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
switch (index) {
case 0:
if (active) {
Expand All @@ -391,6 +391,7 @@ void dip_update(uint8_t index, bool active) {
userspace_config.nuke_switch = active;
break;
}
return true;
}
#endif // KEYBOARD_planck_rev6

Expand Down
3 changes: 2 additions & 1 deletion layouts/community/ortho_4x12/juno/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
return true;
}

void dip_update(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
switch (index) {
case 0:
if (active) {
Expand All @@ -420,6 +420,7 @@ void dip_update(uint8_t index, bool active) {
#endif
}
}
return true;
}

void matrix_scan_user(void) {
Expand Down
3 changes: 2 additions & 1 deletion layouts/community/ortho_4x12/junonum/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
return true;
}

void dip_update(uint8_t index, bool active) {
bool dip_switch_update_user(uint8_t index, bool active) {
switch (index) {
case 0:
if (active) {
Expand All @@ -318,6 +318,7 @@ void dip_update(uint8_t index, bool active) {
#endif
}
}
return true;
}

void matrix_scan_user(void) {
Expand Down

0 comments on commit b703378

Please sign in to comment.