Skip to content

Conversation

@M7T5M3P
Copy link
Contributor

@M7T5M3P M7T5M3P commented Sep 3, 2025

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

Copy link
Member

@Alexander5015 Alexander5015 left a 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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

Copy link
Member

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.

@M7T5M3P
Copy link
Contributor Author

M7T5M3P commented Nov 17, 2025

Is this feature still going to be keep ?

@Alexander5015
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants