Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
makedir opened this issue May 24, 2022 · 12 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@makedir
Copy link

makedir commented May 24, 2022

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:

  • timer which resets when you move the mouse
  • after timer, system executes command, you could use internal command like standby/shutdown/hibernate, or let the user configure a executable or bat file
@lukaslangrock
Copy link
Owner

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

makedir commented Jun 15, 2022

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

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

@lukaslangrock lukaslangrock self-assigned this Jun 15, 2022
@lukaslangrock lukaslangrock added the enhancement New feature or request label Jun 15, 2022
@lukaslangrock lukaslangrock mentioned this issue Jun 15, 2022
14 tasks
@makedir
Copy link
Author

makedir commented Jun 15, 2022

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

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

makedir commented Jun 15, 2022

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

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

lukaslangrock pushed a commit that referenced this issue Jul 15, 2022
@DouglasMoody
Copy link

Status update?

@lukaslangrock
Copy link
Owner

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.

@lukaslangrock lukaslangrock changed the title Feature request: Idle sleep activation, no timers Feature request: reset the timer on mouse movement and add custom commands Apr 19, 2024
@MatheusOliveira-dev
Copy link
Contributor

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:

  • User Privacy: Windows implements security measures to protect user privacy. This means that certain system events, such as mouse movements, can only be intercepted when the application registering the hook is active and in the foreground. This prevents applications from accessing user information without explicit knowledge or consent.

  • Abuse Prevention: The Windows operating system disables low-level hooks when the registering application is minimized or in the background. This measure is taken to prevent abuse by malicious applications that may attempt to capture mouse events without user consent. Thus, the system safeguards user security and privacy of data.

  • Security Restrictions: Windows enforces security restrictions to protect the integrity and stability of the operating system. These restrictions ensure that applications can only access necessary resources in a controlled manner, limiting the ability to intercept system events when the application is not actively interacting with the user.

@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
Copy link
Owner

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 added a commit that referenced this issue Apr 20, 2024
Adds very simple implementation of the mouse inactivity request of #18, along with a foundation for adding keyboard hotkeys. Also includes some restructuring that I did along the way.
@lukaslangrock
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants