rcaelers / workrave

Workrave is a program that assists in the recovery and prevention of Repetitive Strain Injury (RSI). The program frequently alerts you to take micro-pauses, rest breaks and restricts you to your daily limit.
https://www.workrave.org
GNU General Public License v3.0
1.56k stars 199 forks source link

Gamepad input isn't tracked by input monitor #478

Open kmcnaught opened 1 year ago

kmcnaught commented 1 year ago

Describe the bug If you are using the gamepad but no keyboard / mouse input, WorkRave thinks you are inactive.

Different but related to #245

To Reproduce There are two monitors available, each with a different problem.

In the preferences, in the timers section, monitoring tab. Check 'Use alternate monitor' checkbox and restart. Now use the gamepad buttons but no keyboard mouse. WorkRave doesn't prompt you to take a break.

Conversely with the standard monitor, WorkRave thinks you are always active as per #245 as long as the gamepad is connected.

Expected behavior Using the gamepad should be counted as activity and you should be prompted to take breaks

Version

Additional context A user is using OptiKey as an alternative input to keyboard and mouse due to a disability. They also use WorkRave to avoid eye strain. When controlling Optikey they look with their eyes (i.e. an eye tracking engine processes input and computes gaze position, Optikey subscribes to this input stream) and perform clicks with a switch connected to a gamepad (Xbox Adaptive Controller). This means that there are long periods of active work in which there are no keyboard inputs or mouse inputs but the user is very much actively using the computer.

Proposed fix I presume that one could hook up to the Raw Input API in the same way WorkRave currently uses LowLevelKeyboardProc and LowLevelMouseProc. I would be happy to raise a PR if you could sign off on the general idea, and let me know whether it's best incorporated into the "alternate monitor" or as a separate feature toggle or third monitor type? I'm not sure of the side effects in other people's workflows, whether there would be situations in which you don't want these inputs counted.

rcaelers commented 1 year ago

Pull requests are welcome. If the Raw Input API covers all mouse/keyboard tracking, I would prefer a new monitor type. Otherwise, integrate it into the alternate monitor and maybe an option to turn this on/off.