LaunchMenu / node-global-key-listener

A package to listen to global key events
MIT License
94 stars 11 forks source link

Error on listener #23

Open A-DBN opened 2 years ago

A-DBN commented 2 years ago

Hi, I have a problem when pressing a key with the function onKey

Here is my code:

v.addListener('keydown', (e, down) => {
    if (e.key === 'L' && down['LEFT CTRL'] && e.state === 'DOWN') {
        isActive = !false
    }
})

Here is the error:

TypeError: onKey is not a function
    at WinKeyServer.GlobalKeyboardListener.baseListener [as listener] 
    at Socket.<anonymous> (C:\Users\adabi\Desktop\Epitech\Dofus_Passe_Tour\node_modules\node-global-key-listener\build\ts\WinKeyServer.js:36:48)
    at Socket.emit (node:events:539:35)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:285:11)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)