Page 1 of 2
set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 16, 2015 9:36 am
by ajb
I use LiveCode to control behavioral experiments.
I need the cursor to be invisible to the user for a few minutes, and I also need to make sure that any accidental user clicks have no effect during that period. In older versions of LiveCode I used “set the cursor to none” for that purpose, and it worked perfectly. This does not seem to work in LiveCode 7.0.3 (I just tried a beta version of LiveCode 8 with the same effect). Am I missing something? Is there an easy solution to that problem?
Axel
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 16, 2015 10:25 am
by bn
Hi Axel,
I see in LC 6.7.4 rc-1 the same.
The workaround is to use a fully transparent png as cursor
I attach a little stack that shows this.
Additionally I found that setting the cursor to an very high id that does not exists crashes LC 6.7.4 rc-1 (was trying to be smart and set the cursor to an non-existing id)
I will report both bugs.
Kind regards
Bernd
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 16, 2015 11:00 am
by bn
I reported two bugs
Bug 14966 - set cursor to none not working
Bug 14965 - setting cursor to id of non-existing image crashes LC 7.0.4 rc1
Kind regards
Bernd
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 16, 2015 2:38 pm
by Mark
Hi,
This seems to work fine in LC 8-dp-1 on Windows. Did it get fixed or is it a platform-specific issue?
Kind regards,
Mark
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 16, 2015 2:42 pm
by bn
Hi Mark,
I tested now that you mention it in LC8 dp1 on MacOSX 10.9.5
It is the same as described above: Cursor to none does not work, crash when setting cursor to id of an non-existing image
Kind regards
Bernd
Re: set the cursor to none not working in LC 7.0.3
Posted: Wed Mar 18, 2015 11:30 am
by ajb
Hi Bernd,
Thank you very much for reporting the errors and for the helpful cursor script. I will try to adapt your script to my stack.
However, there is one remaining problem with the script: Although the cursor is invisible, it is still “there” and has a hotspot. Thus, when someone uses the mouse and clicks on an object, then that click causes an event and thus possibly an unwanted action. In my case, if this would happen, it could ruin the experiment and I would loose data.
This was not the case with “set the cursor to none”. I thus hope very strongly that the bug gets fixed very soon.
Kind regards,
Axel
Re: set the cursor to none not working in LC 7.0.3
Posted: Wed Mar 18, 2015 12:24 pm
by bn
Hi Axel,
until the bug gets fixed you could add to your controls, a button for example:
Code: Select all
if the lockCursor then exit mouseUp
it is ugly but better than a ruined experiment
Kind regards
Bernd
Re: set the cursor to none not working in LC 7.0.3
Posted: Wed Mar 18, 2015 10:15 pm
by ajb
Hi Bernd,
Thanks, this is a clever workaround!
I have one more question: where would I have to put this command to filter clicks in the backdrop area? (I have to use monitors of varying sizes, so I have a card centered on the screen surrounded by a gray backdrop to cover the rest of the screen, however large it may be.) I have tried card and stack scripts, but events generated by clicking into the backdrop area do not seem to surface there.
Thank you for all your help!
Axel
Re: set the cursor to none not working in LC 7.0.3
Posted: Thu Mar 19, 2015 10:14 am
by bn
Hi Axel,
I have tried card and stack scripts, but events generated by clicking into the backdrop area do not seem to surface there.
If you want to respond to clicks in the background look at mouseDownInBackground and mouseUpInBackground.
in the IDE clicking in backdrop seems to make a distracting short flash of the stack.
if you want to prevent the user reaching the background with the mouse at all then here is a stack that interceptst the mouseScreenLoc.
The handler is in the card script and is started by either button "hide cursor for 3 seconds" or "backDropOn"
This prevents most of the time the cursor getting out of the rect of the stack.
Have a look if this is what you want.
Kind regards
Bernd
Re: set the cursor to none not working in LC 7.0.3
Posted: Fri Mar 20, 2015 3:33 pm
by ajb
Thank you again! I needed to do extensive adaptation to get this running in my stack, but now it seems to work in most cases, and I just hope that the few cases in which it cannot work because my stack does special things will not cause (too many) fatal errors. Great!
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 27, 2017 2:49 pm
by okk
Hi all, I tried to run Bernds scrip in LC 8.1.1. and I can not get even his workaround to work anymore. I have a stack that is drawing some gps data and I don't want the cursor to be seen while it is drawing. Using lock cursor / set cursor to none works within a single handler, but since I use a "send handler in x milliseconds" structure the cursor immediately shows up when it is moved between the execution of the handler. Does anyone have solved the "setting the cursor to none" issue in LC 8.1.1? I work on MacOs 10.10.5.
Thanks. Oliver
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 27, 2017 7:54 pm
by dunbarx
Hi.
Setting the cursor to none surely (or will soon) hide it, but does not eliminate the hotSpot. It may be that we need a "disableCursor" property, or better, another parameter to the cursor property itself, set the cursor to "reallyNonExistant".
So your users could still accidentally click on something they should not.
Craig Newman
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 27, 2017 7:59 pm
by bn
Hi Oliver,
I tried the stack in LC 9 DP6 and it works, however it does not work in version LC 8.1.1 to 8.1.3 as you discovered.
Kind regards
Bernd
Re: set the cursor to none not working in LC 7.0.3
Posted: Mon Mar 27, 2017 9:18 pm
by bn
Hi Oliver,
as a matter of fact as far as I have seen in "cursory" testing all features of the cursor hiding and showing/locking seem to be working in DP6, the testStack started to work in DP5, I can not find the pull request for this but anyhow.
Kind regards
Bernd
Re: set the cursor to none not working in LC 7.0.3
Posted: Tue Mar 28, 2017 1:31 pm
by okk
Hi Bernd,
thanks for hint. I will test it myself with LC 9 DP6 to see if I get it to work. According to dunbarx setting cursor to none will NOT prevent the user from clicking randomly on the stack; it was my impression that this was precisely the idea of setting the cursor to none? Did I misunderstood? In the dictionary it only says setting cursor to none will hide it. It doesn't say if hiding also prevents clicking on objects. Thanks for any insights.