LaunchMenu / node-global-key-listener

A package to listen to global key events
MIT License
95 stars 12 forks source link

Does not work on Ubuntu #32

Open syap6999 opened 2 years ago

syap6999 commented 2 years ago

Thank you so much for creating this project. We tried to implement this and we were successful in the Windows build as well as in Mac. However, it does not seem to work in Ubuntu 20.04. Not really sure why that is. Is there any additional configuration specifically for Ubuntu? The cpp part is a little outside of my expertise.

Upon tracing the code, this listener on the x11ServerKey does not seem to get called.

this.proc.stdout.on("data", data => {
      const events = this._getEventData(data);
      for (let { event, eventId } of events) {
          const stopPropagation = !!this.listener(event);
          this.proc.stdin.write(`${stopPropagation ? "1" : "0"},${eventId}\n`);
      }
});

The process child does get initialized. Just listener not listening.

Any idea how to go about this? Let me know if you need more info.

Thank you so much.

sancarn commented 2 years ago

Can you check the x11 server is actually included in your npm package? If it isnt this may be because I haven't republished to npm yet...

Unfortunately I am no linux expert and have no experience, but @futpib may have an idea / be able to help...

syap6999 commented 2 years ago

Yes, we have installed the @futpib 's npm package. x11server is there and is utilized. It's just that it won't listen. Not sure if an event was sent with every key press.

futpib commented 1 year ago

I believe ubuntu is on wayland by default and there is no keylogging APIs on wayland.