Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

132行 连击加长按会在短时延时到时时会触发一次按下按键吧? #24

Open
wangda123yuan opened this issue Mar 23, 2022 · 1 comment

Comments

@wangda123yuan
Copy link

第133行是不是想写成
handle->state = 1;

@wangda123yuan wangda123yuan changed the title 132行 连击加长按会在短时延时会触发一次按下按键吧? 132行 连击加长按会在短时延时到时时会触发一次按下按键吧? Mar 23, 2022
@Advanced-lj
Copy link
Contributor

确实存在该问题,修改为如下代码可解决:

  case 3:
    if(handle->button_level != handle->active_level) { //released press up
      handle->event = (uint8_t)PRESS_UP;
      EVENT_CB(PRESS_UP);
      if(handle->ticks < SHORT_TICKS) {
        handle->ticks = 0;
        handle->state = 2; //repeat press
      } else {
        handle->state = 0;
      }
    } else if(handle->ticks > SHORT_TICKS) { // long press up
      handle->state = 1; // 0修改为1
    }
    break;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants