Handling clicks outside the window

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Cool Dave
Posts: 35
Joined: Mon Jun 25, 2012 8:44 pm

Handling clicks outside the window

Post by Cool Dave » Tue Jul 10, 2012 8:34 pm

I need a bit of script that will alert me when the user clicks his mouse, regardless of whether it's in my stack window. It would be preferable if it worked for right click as well.

The only way I have thought of is rather unacceptable. Have a semi-transparent mask over the whole screen, and on mouseup, clear the mask and click at the location on the screen where the click had been. However, this is an app that sits on your desktop, perhaps floating above everything, which does a fairly simple task whenever you click.

What are my options? Don't overlook the simple way to do it...I don't know it.

Thanks,
Dave

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Handling clicks outside the window

Post by townsend » Wed Jul 11, 2012 12:04 am

I don't know if a "semi-transparent mask" is possible, but I have experimented with stack size transparent images. I don't have a solution for you, but I may be able to narrow down your options.

In my tests, I put up a stack size transparent image. Only the text appeared. The background was clear with the underlying desktop, or my browser showing underneath. I had a close this stack statement in the on mouseUp handler. The interesting thing was, the mouse click was only triggered when I clicked on the text itself. If I clicked in between lines or anywhere in the empty space, the click was not recognized by LiveCode and passed through to the desktop or my browser.

Reading your message, it occured to me that if you used a pass mouseUp in the mouseUp handler, the mouse click might be triggered in the card or stack area. I don't know. Maybe someone else does, or you could run a test.

Here's other perspective on the same problem. I use a screen capture utility and I've got the hot key set to F9. It works fine. Any application In any application-- when I press F9-- the screen capture program pops up with a capture rectangle. That's a little encouraging. A minimized application can trigger function key or control key combinations. But there you'd probably have to be using the system API. AND-- whether or not the API could get you regular mouse clicks, remains to be seen.

So that's my two cents. No solution, but I think there are two good questions in there.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Handling clicks outside the window

Post by mwieder » Wed Jul 11, 2012 12:21 am

Dave-

Also, see if the suspendStack message works for your purpose. In theory, this message should trigger when the OS moves focus from your stack to another application. There's also a corresponding resumeStack message.

Cool Dave
Posts: 35
Joined: Mon Jun 25, 2012 8:44 pm

Re: Handling clicks outside the window

Post by Cool Dave » Wed Jul 11, 2012 3:54 pm

Hmmm,
Doesn't look like this is really possible. There's probably no way to sense an exterior click, at least in LC. And I'm pretty sure that LC can't click on your screen outside of a rev stack.

So much for that app! (speaking of my idea) It was something that senses your clicks and keeps track of what you have done.

Thanks everyone for your input and ideas.
Dave

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: Handling clicks outside the window

Post by townsend » Wed Jul 11, 2012 5:21 pm

So much for that app! (speaking of my idea) It was something that senses your clicks and keeps track of what you have done.
Actually-- I think this is a good idea. Maybe rather than keeping track of every click, you could have LiveCode popUp a window every so often. The user could set the interval for the time check. For instance, every 15 minutes a popUp window would ask:
What have you been doing the last 15 minutes?
1) Working on Project A
2) Working on Project B
3) Eating Lunch
4) Wasting Time

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Handling clicks outside the window

Post by sturgis » Wed Jul 11, 2012 5:42 pm

Its possible to make an external that will allow clicks outside the rev screen, so maybe its possible to create a mouseclick monitor external? Not sure, I am horrid at c so if its possible its beyond me by a long shot.

Something to think about though.
Cool Dave wrote:Hmmm,
Doesn't look like this is really possible. There's probably no way to sense an exterior click, at least in LC. And I'm pretty sure that LC can't click on your screen outside of a rev stack.

So much for that app! (speaking of my idea) It was something that senses your clicks and keeps track of what you have done.

Thanks everyone for your input and ideas.
Dave

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Handling clicks outside the window

Post by shaosean » Thu Jul 12, 2012 2:42 am

I can look in to it, but it will be a couple of weeks though (unless someone else beats me to it)..

Cool Dave
Posts: 35
Joined: Mon Jun 25, 2012 8:44 pm

Re: Handling clicks outside the window

Post by Cool Dave » Thu Jul 12, 2012 3:27 am

My idea wasn't too well developed anyway. I overheard some guys saying how handy it would be to have a little app that remembered your last ten clicks. So if you got distracted, you could still remember what you had and had not done, and what you were doing. Of course ten isn't nearly enough, but it gave me an idea. Take small screenshots at the clickloc and display them in a stack which is accessed from the taskbar. Scroll through your last 50 clicklocs, and you'll know what you were doing.

So unless someone comes up with a way to do it, I'll shelve the idea.

Townsend, after running a test, no, pass mouseup doesn't transfer it to the desktop. I'm not sure what to do with the screen capture info you gave me, but that program wasn't made in rev anyway, was it?

And BTW I figure that using the 15-minute idea, the app might be a little more trouble to the user than it's worth. And, as you can see now, it doesn't really fit my purpose.

Thanks for the input everyone,
Dave

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

Re: Handling clicks outside the window

Post by sritcp » Sat Jul 14, 2012 7:02 pm

Dave,

This web app may be of interest to you:
http://www.tenxer.com/

Regards,
Sri.

Post Reply