fyhuang / enjoy2

Transform joystick input into keyboard and mouse events (OSX)
MIT License
363 stars 55 forks source link

#7 Fix an issue where mouse movement stops being detected. #16

Closed harryhope closed 9 years ago

harryhope commented 9 years ago

This commit addresses https://github.com/fyhuang/enjoy2/issues/7

On OSX 10.9 and 10.10 app nap causes enjoy to stop recognizing mouse movement input after a brief period of time. This uses beginActivityWithOptions to prevent the app from idling and being unable to control the cursor.

Reference: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSProcessInfo_Class/index.html#//apple_ref/occ/instm/NSProcessInfo/beginActivityWithOptions:reason:

fyhuang commented 9 years ago

Looks good, thanks!