set the cursor to none not working in LC 7.0.3

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

ajb
Posts: 4
Joined: Mon Mar 16, 2015 9:28 am

set the cursor to none not working in LC 7.0.3

Post by ajb » Mon Mar 16, 2015 9:36 am

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: set the cursor to none not working in LC 7.0.3

Post by bn » Mon Mar 16, 2015 10:25 am

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
Attachments
CursorNone.livecode.zip
(1.61 KiB) Downloaded 311 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: set the cursor to none not working in LC 7.0.3

Post by bn » Mon Mar 16, 2015 11:00 am

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

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: set the cursor to none not working in LC 7.0.3

Post by Mark » Mon Mar 16, 2015 2:38 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: set the cursor to none not working in LC 7.0.3

Post by bn » Mon Mar 16, 2015 2:42 pm

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

ajb
Posts: 4
Joined: Mon Mar 16, 2015 9:28 am

Re: set the cursor to none not working in LC 7.0.3

Post by ajb » Wed Mar 18, 2015 11:30 am

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: set the cursor to none not working in LC 7.0.3

Post by bn » Wed Mar 18, 2015 12:24 pm

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

ajb
Posts: 4
Joined: Mon Mar 16, 2015 9:28 am

Re: set the cursor to none not working in LC 7.0.3

Post by ajb » Wed Mar 18, 2015 10:15 pm

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: set the cursor to none not working in LC 7.0.3

Post by bn » Thu Mar 19, 2015 10:14 am

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
Attachments
CursorNone2.livecode.zip
(2.04 KiB) Downloaded 311 times

ajb
Posts: 4
Joined: Mon Mar 16, 2015 9:28 am

Re: set the cursor to none not working in LC 7.0.3

Post by ajb » Fri Mar 20, 2015 3:33 pm

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!

okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

Re: set the cursor to none not working in LC 7.0.3

Post by okk » Mon Mar 27, 2017 2:49 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: set the cursor to none not working in LC 7.0.3

Post by dunbarx » Mon Mar 27, 2017 7:54 pm

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: set the cursor to none not working in LC 7.0.3

Post by bn » Mon Mar 27, 2017 7:59 pm

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3990
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: set the cursor to none not working in LC 7.0.3

Post by bn » Mon Mar 27, 2017 9:18 pm

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

okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

Re: set the cursor to none not working in LC 7.0.3

Post by okk » Tue Mar 28, 2017 1:31 pm

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.

Post Reply

Return to “Mac OS”