Skip to content

The unbinding of the hotkeys.unbind method is invalid. #499

@xiaoxiaohuayu

Description

@xiaoxiaohuayu

This is Demo.I don't understand why the unbinding failed.

let mark = false
    const kVeh = ['1','2','3','4']
    kVeh.forEach((v)=>{
        hotkeys(v,(event, handler)=>{
            console.log('handler.key',handler.key)
            mark = true
        })
    })
    setInterval(()=>{
        console.log('mark',mark)
        if(mark){
            /* good **/
            // hotkeys.unbind()
            /* bad **/
            hotkeys.unbind('1', (event, handler) => {
                console.log('unbind 1 key', handler.key)
                return false
            })
        }
    },1000)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions