-
-
Notifications
You must be signed in to change notification settings - Fork 385
Feat: animated face, mouse traker, and sleepy eyes #751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I left some feedback, I will look at it more when I get the chance.
| } | ||
|
|
||
| func startMouseTracking() { | ||
| timer = Timer.scheduledTimer(withTimeInterval: 1/60.0, repeats: true) { _ in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be very inefficient. I am pretty sure there are event monitors that would be more performant, but I don't know off the top of my head.
| let screenHeight = NSScreen.main?.frame.height ?? 1080 | ||
| let screenCenter = CGPoint(x: screenWidth / 2, y: screenHeight / 2) | ||
|
|
||
| let dx = mouseLocation.x - screenCenter.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be based on the pupil location rather than the center of the screen?
| private func startZZZAnimation() { | ||
| let duration = 3.0 | ||
|
|
||
| Timer.scheduledTimer(withTimeInterval: 1.5, repeats: true) { _ in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be possible to do this without timers? Not sure, but make sure to invalidate timers if they are necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think generally it would be best practice to do the mouse tracking/sleep tracking logic in a separate file.
|
Is this feature still going to be keep ? |
|
I left some feedback before which I don't think has been addressed yet. Also, there are other contributors who want to work on new options when idle, so whichever one I merge first has to allow for other options to be selected. |
I've added a mouse tracker for the Face display, and a sleepy animation (when the mouse hasn't move for 10 seconds).
Here are the videos.
Enregistrement de l’écran 2025-09-03 à 03.29.23.zip
Enregistrement.de.l.ecran.2025-09-03.a.03.34.49.mov
I had to zip the first video it's too big to upload, it's just me demonstrating the mouse tracking