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

为什么回调连击的时候不修改事件 #44

Open
github-dftan opened this issue Apr 17, 2024 · 0 comments
Open

为什么回调连击的时候不修改事件 #44

github-dftan opened this issue Apr 17, 2024 · 0 comments

Comments

@github-dftan
Copy link

case 2:
    if (handle->button_level == handle->active_level) {
        handle->event = (uint8_t)PRESS_DOWN;
        EVENT_CB(PRESS_DOWN);
        handle->repeat++;
        handle->event = (uint8_t)PRESS_REPEAT;//为什么不加这句,不加回调出去不就错了事件类型。
        EVENT_CB(PRESS_REPEAT);
        handle->ticks = 0;
        handle->state = 3;
    } else if (handle->ticks > SHORT_TICKS) {
        if (handle->repeat == 1) {
            handle->event = (uint8_t)SINGLE_CLICK;
            EVENT_CB(SINGLE_CLICK);
        } else if (handle->repeat == 2) {
            handle->event = (uint8_t)DOUBLE_CLICK;
            EVENT_CB(DOUBLE_CLICK);
        }
@github-dftan github-dftan changed the title 为什么回调连击的时候 为什么回调连击的时候不修改事件 Apr 17, 2024
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

1 participant