Welcome Guest.   Make a donation to an author on the site November 29, 2014, 01:22:35 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.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Trigger on Mouse Hover  (Read 8198 times)
noth(a)nk.you
Charter Member
***
Posts: 78


More than meets the eye.

View Profile Give some DonationCredits to this forum member
« on: January 12, 2006, 04:32:26 AM »

It's a pretty confusing title, but it could probably be done pretty easily.  The idea is to sense the presence of the cursor in certain [defined] areas of the screen for some [defined] duration, then perform some [defined] action.  I think that this program exist[s/ed?] as Green Screen for power settings, but I have not been able to find much.

I'd like this program for that same purpose (e.g. turning off the monitor when going to bed, starting the screensaver when walking away, shutting down at the end of the work day, etc.), but I can see usefulness for launching programs.

It could be customized at first by calling some text file, but it would ideally exhibit:
-rule customization in GUI, selecting parts of a current screenshot
-context sensitive (i.e. only work while looking at the desktop so as not to shut down while watching a movie)

I'm thinking it could use rectangular areas, based on pixel/percentage coordinates of the UL and LR corners, then check for the cursor's presence in that area for some amount of time.

No doubt there is someone who has a better way of doing this, but I was thinking something along the lines of: Check Cursor Good -> Wait for x seconds (while checking) -> Perform action.  Along the lines of this sub-par pseudocode:

[copy or print]
const N;
int action[N] UL LR;
int main ()
{
    while(1)
        for ( n = 0; n <= N; ++n %= N)                        //counts modulo N
            action[n] += ( check(n) ? 50ms : -action[N] );    //check position against 'rule n'
            if action[n] >= 5000 ms                           //if it holds out long enough
                perform(n);                                   //go for it!
            end
        end
    wait 50ms                                                 //don't eat the processor
    end
}

bool check (n)
{
    switch (n)
        case 0: UL = (900 700); LR = (950 700); break;        //define span
        case 1: ...
        ...
        case N: ...
    end
    return ( (mPos[0]>=UL[0]) && (mPos[1]<=LR[1]) && ... ) )  //is it in there?
}

void perform (n)
{
    switch (n)
        case 0: ScreensaverStart ()
        case 1: Hibernate ()
        ...
        case N: ShutDown ()
    end
}

I shudder to think what would happen with overlapping zones.  Sad

Thanks for your time and thoughts, Ben
« Last Edit: February 07, 2006, 04:09:47 AM by brotherS » Logged
noth(a)nk.you
Charter Member
***
Posts: 78


More than meets the eye.

View Profile Give some DonationCredits to this forum member
« Reply #1 on: January 13, 2006, 11:26:47 AM »

Is this perhaps similar to Skrommel's MouseActivate?

[I don't know how to do it, but] could this be modified to launch programs/power settings?
Logged
mouser
First Author
Administrator
*****
Posts: 33,706



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: January 13, 2006, 11:41:34 AM »

i know there there are some good existing tools to trigger when the mouse is in certain locations, or with certain gestures.  i'm hoping someone will post some.  (maybe powerpro?)
i don't think this is what mouseactivate does though..
Logged
noth(a)nk.you
Charter Member
***
Posts: 78


More than meets the eye.

View Profile Give some DonationCredits to this forum member
« Reply #3 on: January 26, 2006, 12:55:44 AM »

I found a utility to accomplish the end goal, AMPsoft Screen Saver Control [http://www.ampsoft.net/utilities/ScreenSaverControl.php].  It allows triggers from tray icon, hotkey, or command-line for screensaver and monitor power off.

Also, AMP WinOFF [http://www.ampsoft.net/utilities/WinOFF.php] has a bunch of options for shutdown-related tasks.
Logged
hwtan
Charter Member
***
Posts: 72



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #4 on: January 29, 2006, 12:08:01 PM »

Coded this as "Maomi Activate On Mouse Idle".

Maomi is available from http://www.streamload.com/hwt/Projects/Maomi/

Interested parties, please download and install the Maomi.msi file and run the Maomi.exe in the target directory.
No manual written yet, but it shouldn't be too difficult to figure out the project tongue
Logged
mouser
First Author
Administrator
*****
Posts: 33,706



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: January 31, 2006, 04:43:02 AM »

ethan was very nice enough to send me a package with the latest version of Maomi to be added to the Coding Snacks page, where it now lives: http://www.donationcoder....om/CodingSnacks/index.php
Logged
mouser
First Author
Administrator
*****
Posts: 33,706



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: February 07, 2006, 02:36:19 AM »

ethan has very generously provided the source code for Maomi in the release now - very very cool.
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.027s | Server load: 0 ]