How to change cursor with ctrl and shift?
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Mon Jan 14 07:27:40 EST 2008
Some additional information:
There are three messages you can use in such a case that are sent
every 200 ms.
. Idle does not expects that the cursor is within any control rect
and will be sent to the current card continuously: avoid to use it
for this reason :-)
. MouseWithin (like mouseStillDown) will be only sent to a control
when the mouse hovers it even if the cursor is not moved: less
intrusive yet :-)
. MouseMove will be only sent to a control when the mouse is moved
within the control rect: this one is the less overloading CPU use: as
soon as you can use it, prefer it :-)
But in your case, MouseWithin seems to be the more appropriate
because the cursor will change even if the mouse is not moved.
Le 14 janv. 08 à 13:15, Sakari Ruoho a écrit :
> Wow! Thank you! Never even noticed mouseWithin handler or ignored
> it.. Problem solved
>
>
> On Jan 14, 2008, at 1:40 PM, Eric Chatonet wrote:
>
>> Hi Sakari,
>>
>> Le 14 janv. 08 à 12:07, Sakari Ruoho a écrit :
>>
>>> Hello folks,
>>>
>>> Was wondering how to change the mouse cursor behavior, when user
>>> presses either ctrl or shift key? Like in photoshop with select
>>> tool where u can add to selection by pressing shift and remove
>>> from selection by pressing ctrl? If anyone has implemented
>>> anything like this, any help would be appreaciated. Thank you!
>>>
>>> Sakari Ruoho
>>> Software Designer
>>> sakari.ruoho at academica.com
>>
>> To achieve this you can use a mouseWithin handler:
>>
>> on mouseWithin
>> if the shiftKey is dow then set the cursor to x
>> else if the optionKey is down then set the cursor to y
>> else set the cursor to z
>> lock cursor
>> end mouseWithin
>> -------------------------------------
>> on mouseLeave
>> unlock cursor
>> end mouseLeave
>>
>> By default mouseWithin will be sent every 200 ms but you can
>> adjust this value by setting the idleRate (or idleTicks) property.
>>
>> Best regards from Paris,
>> Eric Chatonet.
Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------
More information about the use-livecode
mailing list