TeamMidnightDust / MidnightControls

A Minecraft mod adding controller support and enhanced controls overall.
https://midnightdust.eu/midnightcontrols/
MIT License
174 stars 28 forks source link

Eye Tracking Support, No-Hands Minecraft #208

Closed kabliz closed 9 months ago

kabliz commented 1 year ago

Add support for eye tracking hardware, for example the Tobii 5, used as an alternative to mice. Combined with the rest of MidnightControls' other features, this allows a way to play Minecraft without using hands, for both tech enthusiasts and those who do not have the use of their hands for their computer.

The implementation is not hardware specific: any eye tracking device that used to control the cursor will work the same. The difference between eye tracking and normal mouse behavior is only a little math to interpret the cursor movement. I believe I have left plenty of inline comments, but let me know if there are more questions I could leave better documentation on.

I also believe this feature should be pretty stable, regardless of what Mojang changes in future updates - I don't have much reason to believe they would change cursor behavior. The one major dependency is around the client.player.changeLookDirection() call from Mouse.updateMouse(), but otherwise interfacing with the rest of the base game is kept to a minimum.

New settings copy has been created for toggling the setting on & off, and for adjusting the deadzone around the cursor.

One limitation: Ranged combat is possible, but harder than intended. I am able to play on Easy, but I don't have a better idea that wouldn't be considered cheating or needing server-side mods. Since there are are many players interested in Creative Mode, redstoning, or Survival Easy, I still feel that this feature is still worthwhile enough.

Contributor's test setup:

Motschen commented 9 months ago

Thank you very much for this great work! It'll be included in the soon-to-be-published 1.20.2 release :)