Welcome Guest.   Make a donation to an author on the site July 29, 2014, 11:55:07 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Read the Practical Guide to DonationCoder.com Forum Search Features
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: IDEA: screensaver / monitor timeouts to IGNORE small mouse jitters  (Read 3401 times)
kaon
Supporting Member
**
Posts: 4


View Profile Give some DonationCredits to this forum member
« on: June 13, 2008, 11:14:19 AM »

Background:
When Windows detects no keyboard/mouse activity for the set number of minutes, it starts the starts screensaver or signals the monitor to go into powersave mode.

Problem statement:
We do not want the OS the wake the monitor up in response to unintended mouse movements or optical mouse jitters that plague low-cost mouses.

Suggestion:
We need to modify or hook into the way the OS wakes the monitor up. Ignore movements of less than N pixels, or movements that are not smoothly continuous for at least M milliseconds.
Alternatively, is there a way in WinXP to tell the OS to ignore mouse inputs altogether, when in screensaver mode?

Extra credit:
As much as possible, power down that energy-sucking 3D graphics card when in monitor is in powersaving mode.

PS: Thank you for monoff.exe
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: June 13, 2008, 09:19:02 PM »

 smiley Here's Jiggle!

It prevents small mouse movements from stopping the screensaver.

Skrommel

[copy or print]
;Jiggle.ahk
; Prevents small mouse movements from stopping the screensaver
;Skrommel @ 2008

#SingleInstance,Force
#Persistent,On
SetBatchLines,-1

SetTimer,CHECKSCREENSAVER,1000
Return


CHECKSCREENSAVER:                     ;is the screensaver running
  oldactive:=active
  VarSetCapacity(active,4,0)
  DllCall("user32.dll\SystemParametersInfo","uint",0x0072,"uint",0,"uint*",active,"uint",0) ; SPI_GETSCREENSAVERRUNNING = 0x0072 
  If active>0                         ;yes, lock the mouse
    hHookKeybd:=DllCall("SetWindowsHookEx",Int,14,Uint,RegisterCallback("CHECKMOUSEMOVE","F"),UInt
               ,DllCall("GetModuleHandle",UInt,0),UInt,0)  ; WH_MOUSE_LL = 14
  Else
  If oldactive=1                      ;no, check if it has run, if so, stop watching the mouse
    Reload
Return


CHECKMOUSEMOVE(nCode,wParam,lParam)
{
   Global blockMouse
   Global counter
   
   If A_TimeIdlePhysical<1000          ;has the system not been idle
   {
     counter+=1
     If counter>100                     ;has it not been idle repeatedly
     {
       blockMouse=0                    ;start forwarding the mouse messages
       counter=0
     }
   }
   Else
   {
     blockMouse=1                      ;stop forwarding the mouse messages
     counter=0
   }
   ToolTip,%A_TimeIdlePhysical%-%counter%-%blockmouse%
   Return blockMouse ? 1 : DllCall("CallNextHookEx",UInt,0,Int,nCode,UInt,wParam,UInt,lParam)
}
« Last Edit: June 14, 2008, 09:14:35 AM by skrommel » Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
kaon
Supporting Member
**
Posts: 4


View Profile Give some DonationCredits to this forum member
« Reply #2 on: June 13, 2008, 10:16:16 PM »

smiley Here's Jiggle!

It prevents small mouse movements from stopping the screensaver.

Skrommel

[copy or print]
(EDIT: removed Skrommel's first version, since he his latest is in his first post)
Impressive, thanks!
There was a run time error about line 40, so I moved up line 41 and there was no more error message.
So I was testing it, and it seemed to have no effect, (I simulated unintended small movements by hand, of course) and it often still woke up out of the screen saver, or out of my monoff.exe.
Either it is not working correctly, or I have to increase the aggressiveness.
But I don't really understand the script. Hope you can help.
« Last Edit: June 14, 2008, 01:48:00 PM by kaon » Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: June 14, 2008, 09:16:13 AM »

 tellme If works very well on Vista... Try the script again, I've corrected the line split, commented the script and decreased the sensitivity.

Skrommel
Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
kaon
Supporting Member
**
Posts: 4


View Profile Give some DonationCredits to this forum member
« Reply #4 on: June 14, 2008, 01:57:31 PM »

Thanks for your help Skrommel.
I know the problem now, even though I'm embarrassed to say I still don't understand how the script works. :p

Anyway, it works if I have a normal screensaver really running. I see the tooltip, cool.

It does not work when I use your MonitorOffSaver.scr, or if the "Turn Off Monitor" timeout setting (of WinXP Power Options Properties > Power scheme) is in effect, or if I am using MonOff.exe.

So ideally, this mouse desensitizing should be in effect when monitor is powered off too.

If it simplifies things, how about combining the mouse desensitizing with MonitorOffSaver.scr and with MonOff.exe?

I personally do not use screensavers for the pretty graphics, I always prefer the monitor go into its lowest power mode, or soft-off.

And there's another potential problem:
The idle timer that WinXP uses to decide whether it is time to start the screensaver / switch off the monitor. This timer would keep getting resetted by the mouse jitters, so that the screensaver would never start. I have one such machine in my work place, it has a off-brand optical mouse. Perhaps the simpler solution is to but a new mouse / mousepad for that machine.

Thanks again!
« Last Edit: June 15, 2008, 12:34:50 AM by kaon » Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.031s | Server load: 0.27 ]