lukaslangrock / ShutdownTimerClassic

Pick a time and let your computer shutdown itself.
https://www.microsoft.com/store/apps/9NTDG6C9BTTW?cid=github.com
MIT License
351 stars 41 forks source link

Feature request: reset the timer on mouse movement and add custom commands #18

Open makedir opened 2 years ago

makedir commented 2 years ago

Im looking since years for a opensource program for Windows like this tool, where you can trust the code and wont have to worry that maybe it contains malicious code, which offers the functionality like your tool but also keeps the laptop entering standby / execute command after n time and m no mouse movements.

Could you please implement these simple features:

lukaslangrock commented 2 years ago

Hi there and thanks for your feedback.

I am curious as to why you'd want a feature where the timer resets when there is mouse movement detected. I currently don't really see how that would be a feature of interest (to many). As to the second feature, this one has been on my mind as well and I am working on implementing that.

makedir commented 2 years ago

A timer is important and a needed feature to make a program like this work to put a laptop to sleep, as simple as that. The inbuild idle timer of Windows is not reliable, because it can be deactivated by lots of programs (watching a movie, having a video player open, and so on). ERGO you need a 3rd party program with a timer, which is just bound to mouse movements. That is the only reliable way. If you let your laptop on with a video player for example, it will burn in the monitor and also stay on forever.

Please implement both features, they are important. And simple to implement. Thank you.

lukaslangrock commented 2 years ago

I see now, that would indeed be a good feature. I'll work on that one too.

makedir commented 2 years ago

Thank you that would be great. Maybe you could also implement the 3 main power modes of Windows too next to standby, hibernate, S3 and modern standby as a command to run, or you give a command argument which will be executed so people can select a bat file or ahk (autohotkey) script to do that.

lukaslangrock commented 2 years ago

Executing a custom command/file is something I want to implement, but what do you mean with "3 main power modes of Windows"? The app already supports all the main ones Windows can go into (afaik).

makedir commented 2 years ago

Yes it does indeed 😅sorry that is redundant then. Ive not looked at the program so far, because I need the mouse timer for using it.

lukaslangrock commented 2 years ago

No problem haha, it'll not be long until the update :)

DouglasMoody commented 8 months ago

Status update?

lukaslangrock commented 3 months ago

The feature for executing custom scripts/commands was implemented, the feature regarding resetting the timer on mouse movement is planned but not yet worked on. Both features will probably ship in the next update.

MatheusOliveira-dev commented 3 months ago

I was analyzing and attempting to implement the requested functionality of globally capturing mouse movements, particularly when the application is minimized, and encountered the following complications:

The functionality of globally capturing mouse movements, especially when the application is minimized, is not fully achievable due to various implications related to user privacy and Windows operating system security:

@DouglasMoody @makedir: Does it make sense to implement this feature only when the 'Run in background' option is not used? With the countdown running without this option, the application is not minimized, so it's possible to monitor mouse movements.

@lukaslangrock, are you already working on this? I haven't found a native way to do this without using third-party packages.

lukaslangrock commented 3 months ago

I haven't researched the functionality / Windows-aspect, but I started working on preparing the UI and logic for this feature, keeping hotkey support in mind too. My approach was based on this NuGet package, but I have not tested it yet.

lukaslangrock commented 3 months ago

I uploaded my progress in a new branch. Using this NuGet package it is not possible to detect movements during background operation, but as long as the countdown window is visible (doesn't even need to be in the foreground or focussed), the timer will reset. The feature still needs some work, tho. This is just a demo.