johnno1962 / HotReloading

Hot reloading as a Swift Package
MIT License
540 stars 48 forks source link

Will the DDHotKey affect the file watch ? #80

Closed qmkCamel closed 1 year ago

qmkCamel commented 1 year ago

I use the DDHotKey with command + s in HotReloading as a package, but found it will affect the File Watcher, it cannt get the callback when command + s triggered. I didnt figure out how it happed.

johnno1962 commented 1 year ago

Not sure I understand what you're saying. DDHotKey is compiled into the app. It won't work using HotReloading alone which relies on calling the FileSystemEvent api from inside the simulator so your only option is cmd-s.

qmkCamel commented 1 year ago

I forked a HotReloading and add the DDHotKey in it, and set a cmd + s hotkey. But when I trigger the cmd + s, found the file watcher didn`t get a callback, only the hotkey action triggerd.

johnno1962 commented 1 year ago

I'm surprised DDHotKey works inside the simulator. It uses an old "Carbon" api so the chances of it working are very low. I'll have to leave you to work this one out.

qmkCamel commented 1 year ago

I tried it on device. And I will find a way to work it out. Thanks~

qmkCamel commented 1 year ago

The DDHotKey with cmd + s will delay the FSStreamEventCallback about 10 - 15 seconds on device.

johnno1962 commented 1 year ago

I'm not sure I understand what you're up to. How do you mean "on device"? How could it work "on device"? Have you tried using the existing hot key of control-=? instead?