how to stop mouse clicks from executing?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

how to stop mouse clicks from executing?

larry
I have a situation in my program where I'm showing the user some stuff.  I do not want the user to be able to click with the mouse during this time.
What is the best way to do that?
Actually it would be great if the user couldn't even move the mouse (within my program) during this time.

TIA
Larry
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

Alain Farmer
on showToUser
   set the cursor to none
   -- show

end showToUser


On Monday, September 1, 2014 1:24:32 PM, "[hidden email]" <[hidden email]> wrote:
 


I have a situation in my program where I'm showing the user some stuff.  I do not want the user to be able to click with the mouse during this time.
What is the best way to do that?
Actually it would be great if the user couldn't even move the mouse (within my program) during this time.

TIA
Larry
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

Richmond Mathewson-2
In reply to this post by larry

On 1.09.2014 20:23, [hidden email] wrote:
> I have a situation in my program where I'm showing the user some stuff.  I do not want the user to be able to click with the mouse during this time.
> What is the best way to do that?
> Actually it would be great if the user couldn't even move the mouse (within my program) during this time.
>
> TIA
> Larry
> _______________________________________________
>

How about this sort of code in your cardScript:

on mouseUp
   if fld "NIX" contains 1 then
---do nix
   end if
end mouseUp

then have an offscreen fld "NIX" that you put 1 onto when your slide-show
starts, and you put 'empty' into when it finishes?

of course you could move that script out of the cardScript into all your
buttons on the card
like this:

on mouseUp
   if fld "NIX" contains 1 then
---do nix
else
   --do whatever you want this button to do
   end if
end mouseUp

Richmond.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

Michael Doub
‎ How about setting the cursor to none and locking the cursor‎?

Mike

Original Message  

From: Richmond
Sent: Monday, September 1, 2014 1:59 PM
To: How to use LiveCode
Reply To: How to use LiveCode
Subject: Re: how to stop mouse clicks from executing?


On 1.09.2014 20:23, [hidden email] wrote:
> I have a situation in my program where I'm showing the user some stuff. I do not want the user to be able to click with the mouse during this time.
> What is the best way to do that?
> Actually it would be great if the user couldn't even move the mouse (within my program) during this time.
>
> TIA
> Larry
> _______________________________________________
>

How about this sort of code in your cardScript:

on mouseUp
if fld "NIX" contains 1 then
---do nix
end if
end mouseUp

then have an offscreen fld "NIX" that you put 1 onto when your slide-show
starts, and you put 'empty' into when it finishes?

of course you could move that script out of the cardScript into all your
buttons on the card
like this:

on mouseUp
if fld "NIX" contains 1 then
---do nix
else
--do whatever you want this button to do
end if
end mouseUp

Richmond.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

Richmond Mathewson-2

On 1.09.2014 21:03, [hidden email] wrote:
> ‎ How about setting the cursor to none and locking the cursor‎?

Because the chap may still need the cursor for something else (such as
grab).

>
> Mike
>
> Original Message
>
> From: Richmond
> Sent: Monday, September 1, 2014 1:59 PM
> To: How to use LiveCode
> Reply To: How to use LiveCode
> Subject: Re: how to stop mouse clicks from executing?
>
>
> On 1.09.2014 20:23, [hidden email] wrote:
>> I have a situation in my program where I'm showing the user some stuff. I do not want the user to be able to click with the mouse during this time.
>> What is the best way to do that?
>> Actually it would be great if the user couldn't even move the mouse (within my program) during this time.
>>
>> TIA
>> Larry
>> _______________________________________________
>>
> How about this sort of code in your cardScript:
>
> on mouseUp
> if fld "NIX" contains 1 then
> ---do nix
> end if
> end mouseUp
>
> then have an offscreen fld "NIX" that you put 1 onto when your slide-show
> starts, and you put 'empty' into when it finishes?
>
> of course you could move that script out of the cardScript into all your
> buttons on the card
> like this:
>
> on mouseUp
> if fld "NIX" contains 1 then
> ---do nix
> else
> --do whatever you want this button to do
> end if
> end mouseUp
>
> Richmond.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

Paul Dupuis
insert a frontScript containing mouseDown and mouseUp handlers to trap
those events when you want to block them and remove the frontScript when
done

That will still allow mouseStillDown and mouseRelease messages to be
passed for drag operations

On 9/1/2014 2:14 PM, Richmond wrote:

>
> On 1.09.2014 21:03, [hidden email] wrote:
>> ‎ How about setting the cursor to none and locking the cursor‎?
>
> Because the chap may still need the cursor for something else (such as
> grab).
>
>>
>> Mike
>>
>> Original Message
>>
>> From: Richmond
>> Sent: Monday, September 1, 2014 1:59 PM
>> To: How to use LiveCode
>> Reply To: How to use LiveCode
>> Subject: Re: how to stop mouse clicks from executing?
>>
>>
>> On 1.09.2014 20:23, [hidden email] wrote:
>>> I have a situation in my program where I'm showing the user some
>>> stuff. I do not want the user to be able to click with the mouse
>>> during this time.
>>> What is the best way to do that?
>>> Actually it would be great if the user couldn't even move the mouse
>>> (within my program) during this time.
>>>
>>> TIA
>>> Larry
>>> _______________________________________________
>>>
>> How about this sort of code in your cardScript:
>>
>> on mouseUp
>> if fld "NIX" contains 1 then
>> ---do nix
>> end if
>> end mouseUp
>>
>> then have an offscreen fld "NIX" that you put 1 onto when your
>> slide-show
>> starts, and you put 'empty' into when it finishes?
>>
>> of course you could move that script out of the cardScript into all your
>> buttons on the card
>> like this:
>>
>> on mouseUp
>> if fld "NIX" contains 1 then
>> ---do nix
>> else
>> --do whatever you want this button to do
>> end if
>> end mouseUp
>>
>> Richmond.
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

Richmond Mathewson-2

On 1.09.2014 21:22, Paul Dupuis wrote:
> insert a frontScript containing mouseDown and mouseUp handlers to trap
> those events when you want to block them and remove the frontScript when
> done
>
> That will still allow mouseStillDown and mouseRelease messages to be
> passed for drag operations

That's a clever idea!

>
> On 9/1/2014 2:14 PM, Richmond wrote:
>> On 1.09.2014 21:03, [hidden email] wrote:
>>> ‎ How about setting the cursor to none and locking the cursor‎?
>> Because the chap may still need the cursor for something else (such as
>> grab).
>>
>>> Mike
>>>
>>> Original Message
>>>
>>> From: Richmond
>>> Sent: Monday, September 1, 2014 1:59 PM
>>> To: How to use LiveCode
>>> Reply To: How to use LiveCode
>>> Subject: Re: how to stop mouse clicks from executing?
>>>
>>>
>>> On 1.09.2014 20:23, [hidden email] wrote:
>>>> I have a situation in my program where I'm showing the user some
>>>> stuff. I do not want the user to be able to click with the mouse
>>>> during this time.
>>>> What is the best way to do that?
>>>> Actually it would be great if the user couldn't even move the mouse
>>>> (within my program) during this time.
>>>>
>>>> TIA
>>>> Larry
>>>> _______________________________________________
>>>>
>>> How about this sort of code in your cardScript:
>>>
>>> on mouseUp
>>> if fld "NIX" contains 1 then
>>> ---do nix
>>> end if
>>> end mouseUp
>>>
>>> then have an offscreen fld "NIX" that you put 1 onto when your
>>> slide-show
>>> starts, and you put 'empty' into when it finishes?
>>>
>>> of course you could move that script out of the cardScript into all your
>>> buttons on the card
>>> like this:
>>>
>>> on mouseUp
>>> if fld "NIX" contains 1 then
>>> ---do nix
>>> else
>>> --do whatever you want this button to do
>>> end if
>>> end mouseUp
>>>
>>> Richmond.
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

larry
In reply to this post by Paul Dupuis
Hi Paul,
As Richmond says, "That's a clever idea."
However, I have no understanding of what a frontScript is and no
understanding of how to trap those events.
Perhaps you'd be willing to elaborate for me?
Thanks,
Larry

----- Original Message -----
From: "Paul Dupuis" <[hidden email]>
To: <[hidden email]>
Sent: Monday, September 01, 2014 12:22 PM
Subject: Re: how to stop mouse clicks from executing?


> insert a frontScript containing mouseDown and mouseUp handlers to trap
> those events when you want to block them and remove the frontScript when
> done
>
> That will still allow mouseStillDown and mouseRelease messages to be
> passed for drag operations
>
> On 9/1/2014 2:14 PM, Richmond wrote:
>>
>> On 1.09.2014 21:03, [hidden email] wrote:
>>> ‎ How about setting the cursor to none and locking the cursor‎?
>>
>> Because the chap may still need the cursor for something else (such as
>> grab).
>>
>>>
>>> Mike
>>>
>>> Original Message
>>>
>>> From: Richmond
>>> Sent: Monday, September 1, 2014 1:59 PM
>>> To: How to use LiveCode
>>> Reply To: How to use LiveCode
>>> Subject: Re: how to stop mouse clicks from executing?
>>>
>>>
>>> On 1.09.2014 20:23, [hidden email] wrote:
>>>> I have a situation in my program where I'm showing the user some
>>>> stuff. I do not want the user to be able to click with the mouse
>>>> during this time.
>>>> What is the best way to do that?
>>>> Actually it would be great if the user couldn't even move the mouse
>>>> (within my program) during this time.
>>>>
>>>> TIA
>>>> Larry
>>>> _______________________________________________
>>>>
>>> How about this sort of code in your cardScript:
>>>
>>> on mouseUp
>>> if fld "NIX" contains 1 then
>>> ---do nix
>>> end if
>>> end mouseUp
>>>
>>> then have an offscreen fld "NIX" that you put 1 onto when your
>>> slide-show
>>> starts, and you put 'empty' into when it finishes?
>>>
>>> of course you could move that script out of the cardScript into all your
>>> buttons on the card
>>> like this:
>>>
>>> on mouseUp
>>> if fld "NIX" contains 1 then
>>> ---do nix
>>> else
>>> --do whatever you want this button to do
>>> end if
>>> end mouseUp
>>>
>>> Richmond.
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode 


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

Richmond Mathewson-2

On 1.09.2014 22:50, [hidden email] wrote:
> Hi Paul,
> As Richmond says, "That's a clever idea."
> However, I have no understanding of what a frontScript is and no
> understanding of how to trap those events.

Nor have I :)

and, despite it being clever, I fail to see any particular advantage
over my method.

Richmond.

> Perhaps you'd be willing to elaborate for me?
> Thanks,
> Larry
>
> ----- Original Message ----- From: "Paul Dupuis" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, September 01, 2014 12:22 PM
> Subject: Re: how to stop mouse clicks from executing?
>
>
>> insert a frontScript containing mouseDown and mouseUp handlers to trap
>> those events when you want to block them and remove the frontScript when
>> done
>>
>> That will still allow mouseStillDown and mouseRelease messages to be
>> passed for drag operations
>>
>> On 9/1/2014 2:14 PM, Richmond wrote:
>>>
>>> On 1.09.2014 21:03, [hidden email] wrote:
>>>> ‎ How about setting the cursor to none and locking the cursor‎?
>>>
>>> Because the chap may still need the cursor for something else (such as
>>> grab).
>>>
>>>>
>>>> Mike
>>>>
>>>> Original Message
>>>>
>>>> From: Richmond
>>>> Sent: Monday, September 1, 2014 1:59 PM
>>>> To: How to use LiveCode
>>>> Reply To: How to use LiveCode
>>>> Subject: Re: how to stop mouse clicks from executing?
>>>>
>>>>
>>>> On 1.09.2014 20:23, [hidden email] wrote:
>>>>> I have a situation in my program where I'm showing the user some
>>>>> stuff. I do not want the user to be able to click with the mouse
>>>>> during this time.
>>>>> What is the best way to do that?
>>>>> Actually it would be great if the user couldn't even move the mouse
>>>>> (within my program) during this time.
>>>>>
>>>>> TIA
>>>>> Larry
>>>>> _______________________________________________
>>>>>
>>>> How about this sort of code in your cardScript:
>>>>
>>>> on mouseUp
>>>> if fld "NIX" contains 1 then
>>>> ---do nix
>>>> end if
>>>> end mouseUp
>>>>
>>>> then have an offscreen fld "NIX" that you put 1 onto when your
>>>> slide-show
>>>> starts, and you put 'empty' into when it finishes?
>>>>
>>>> of course you could move that script out of the cardScript into all
>>>> your
>>>> buttons on the card
>>>> like this:
>>>>
>>>> on mouseUp
>>>> if fld "NIX" contains 1 then
>>>> ---do nix
>>>> else
>>>> --do whatever you want this button to do
>>>> end if
>>>> end mouseUp
>>>>
>>>> Richmond.
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode 
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

pmbrig
In reply to this post by larry
On Sep 1, 2014, at 3:50 PM, <[hidden email]> <[hidden email]> wrote:

> Hi Paul,
> As Richmond says, "That's a clever idea."
> However, I have no understanding of what a frontScript is and no understanding of how to trap those events.
> Perhaps you'd be willing to elaborate for me?

Create a button with the following script:

on mousedown
   if <put your conditions here> then
      -- block mousedown
   else
      pass mousedown
   end if
end mousedown

on mouseup
   if <put your conditions here> then
      -- block mouseup
   else
      pass mouseup
   end if
end mouseup

Then in an openstack handler put the following line:
   insert script of btn "myFrontScript" into front

A front script resides at the very front of the message path, and all messages will pass to it before going to any controls, cards, or stacks. Anything not handled by the frontscript will then pass to the normal message path. Any message blocked by the frontscript will stop there without getting passed. Frontscripts are very useful for handling special actions that must prevail everywhere in your stack.

In most cases you will want to be sure to put the following in your closestack handler:
   remove script of btn "myFrontScript" from front
to be sure that your blocking action does not persist when it is not needed.

-- Peter

Peter M. Brigham
[hidden email]
http://home.comcast.net/~pmbrig



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: how to stop mouse clicks from executing?

larry
Hi Peter,
Thanks very much for the explanation.
Larry

----- Original Message -----
From: "Peter M. Brigham" <[hidden email]>
To: "How to use LiveCode" <[hidden email]>
Sent: Tuesday, September 02, 2014 6:12 AM
Subject: Re: how to stop mouse clicks from executing?


> On Sep 1, 2014, at 3:50 PM, <[hidden email]>
> <[hidden email]> wrote:
>
>> Hi Paul,
>> As Richmond says, "That's a clever idea."
>> However, I have no understanding of what a frontScript is and no
>> understanding of how to trap those events.
>> Perhaps you'd be willing to elaborate for me?
>
> Create a button with the following script:
>
> on mousedown
>   if <put your conditions here> then
>      -- block mousedown
>   else
>      pass mousedown
>   end if
> end mousedown
>
> on mouseup
>   if <put your conditions here> then
>      -- block mouseup
>   else
>      pass mouseup
>   end if
> end mouseup
>
> Then in an openstack handler put the following line:
>   insert script of btn "myFrontScript" into front
>
> A front script resides at the very front of the message path, and all
> messages will pass to it before going to any controls, cards, or stacks.
> Anything not handled by the frontscript will then pass to the normal
> message path. Any message blocked by the frontscript will stop there
> without getting passed. Frontscripts are very useful for handling special
> actions that must prevail everywhere in your stack.
>
> In most cases you will want to be sure to put the following in your
> closestack handler:
>   remove script of btn "myFrontScript" from front
> to be sure that your blocking action does not persist when it is not
> needed.
>
> -- Peter
>
> Peter M. Brigham
> [hidden email]
> http://home.comcast.net/~pmbrig
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode 


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode