wilix-team / iohook

Node.js global keyboard and mouse listener.
https://wilix-team.github.io/iohook
MIT License
1.2k stars 291 forks source link

support for electron-75 #199

Closed ykhwong closed 4 years ago

ykhwong commented 5 years ago

The current stable version of the Electron framework is 7.0.0. (https://electronjs.org/) Could you support the version (electron-75)?

Thank you.

Djiit commented 5 years ago

Running the CI right now :)

Djiit commented 5 years ago

I'm sorry it looks we need to update the code to be fully node 12 / elctron 7 compatible. I'll try next week cause i'm a bit busy right now. If anyone wants to help...

ykhwong commented 5 years ago

There was a change to v8::Object::Set in Node 12 that Local< Context > context has been required.

I haven't tested the code yet, but to resolve the issue, I think you can simply add v8::Isolate::GetCurrent()->GetCurrentContext()

For example, in iohook.c(417), change from obj->Set(Nan::New("type").ToLocalChecked(), Nan::New((uint16_t)event.type)); to obj->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), Nan::New("type").ToLocalChecked(), Nan::New((uint16_t)event.type));

ykhwong commented 5 years ago

Replaced all ->Set( with ->Set(v8::Isolate::GetCurrent()->GetCurrentContext(), in the iohook.c as mentioned above and confirmed to be working fine.

zxc23 commented 5 years ago

Hey folks, how's this going?

kkm commented 4 years ago

+1 and asap!

Djiit commented 4 years ago

Hey @ykhwong would you mind creating a PR ? I can't make it work on my side

ykhwong commented 4 years ago

Please note that I only tested with electron-75. (https://github.com/wilix-team/iohook/pull/205) Not sure if it would work with the other runtime versions.

kkm commented 4 years ago

@ykhwong thank you, he will merge soon?

Djiit commented 4 years ago

Thanks!

@kkm I appreciate your energy but please keep in mind we are all volounteers here.

I just published v0.6.2

kkm commented 4 years ago

I understand, and I did not want to offend, and thank you for your work.