Skip to content

Commit

Permalink
重新注册按键后保留原先的长按状态
Browse files Browse the repository at this point in the history
  • Loading branch information
skb666 committed Feb 12, 2024
1 parent afb2234 commit 2ab08d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/combo_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ int8_t key_register(uint16_t id, KEY_VALUE (*get)(void), void *custom_data, uint

key = key_find_by_id(id);
if (key != NULL) {
if (key->press_cnt >= key->long_press) {
key->press_cnt = long_press;
}
key->enable = 1;
key->valid = valid;
key->ageing = ageing;
Expand Down

0 comments on commit 2ab08d6

Please sign in to comment.