Handling clicks outside the window
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Handling clicks outside the window
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
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
Re: Handling clicks outside the window
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.
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.
Re: Handling clicks outside the window
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.
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.
Re: Handling clicks outside the window
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
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
Re: Handling clicks outside the window
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:So much for that app! (speaking of my idea) It was something that senses your clicks and keeps track of what you have done.
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
Re: Handling clicks outside the window
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.
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
Re: Handling clicks outside the window
I can look in to it, but it will be a couple of weeks though (unless someone else beats me to it)..
Re: Handling clicks outside the window
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
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