prashantgupta24 / automatic-mouse-mover

a minimalistic go library/app to keep your mac active and alive
MIT License
306 stars 34 forks source link

Screen Locked / Lid Closed #17

Open afsoltys opened 3 years ago

afsoltys commented 3 years ago

Awesome app - thanks! Question: will this work when if the Mac is locked? How about if the screen of a MacBook is closed?

prashantgupta24 commented 3 years ago

Thank you for the kind words @afsoltys! The main library used for this app is the activity tracker: https://github.com/prashantgupta24/activity-tracker.

The activity tracker implements all handlers, including machineSleepHandler. So whenever a macbook screen is closed or macbook is put to sleep, the activity tracker receives a sleep event, which in turn pauses the automatic mouse mover. So it should not try to move the mouse when the macbook is sleeping.

As far as screen lock is concerned, right now there is no event triggered when the screen is locked. So my assumption is that the automatic mouse mover will keep working when the screen is locked.

The activity tracker is an open source library, so looking forward to contributions on making lock screen events possible!

Hope that helps!

afsoltys commented 3 years ago

Wow - thanks for the super speedy reply! I see, so by design if the mac is put to sleep, amm intentionally stops trying to move the mouse? I will test with the screen lock and see if it behaves as expected (continuing to work).

prashantgupta24 commented 3 years ago

if the mac is put to sleep, amm intentionally stops trying to move the mouse? -> that is correct.

Let me know how the lock screen testing goes, I'm curious to know if it works while locked.