Curses
Forum rules
Be kind.
Be kind.
- richmond62
- Posts: 5288
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Curses
set the cursor to something
does NOT work in recent versions of LiveCode on MacOS:
https://forums.livecode.com/viewtopic.php?f=7&t=37192
does NOT work in recent versions of LiveCode on MacOS:
https://forums.livecode.com/viewtopic.php?f=7&t=37192
- Attachments
-
- Accursed Cursors.livecode.zip
- Stack.
- (4.18 KiB) Downloaded 303 times
https://richmondmathewson.owlstown.net/
- overclockedmind
- Posts: 363
- Joined: Sat Apr 30, 2022 9:05 pm
- Location: Midwest US
- Contact:
Re: Curses
LCC (branded) 963, Linux Mint (Ubuntu 20.04 derivative,) the first two buttons don't do a thing, and the third (last) pops the script of the button as if there's something wrong with the script I'm supposed to see, and fix.richmond62 wrote: ↑Mon Aug 01, 2022 7:16 pm set the cursor to something
does NOT work in recent versions of LiveCode on MacOS:
https://forums.livecode.com/viewtopic.php?f=7&t=37192
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win10 Pro, Current)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
- OpenXTalkPaul
- Posts: 2836
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Curses
Invisible Cursor works here, must lock the cursor before and/or (?) after changing the cursor:richmond62 wrote: ↑Mon Aug 01, 2022 7:16 pm set the cursor to something
does NOT work in recent versions of LiveCode on MacOS:
https://forums.livecode.com/viewtopic.php?f=7&t=37192
Code: Select all
lock cursor; set the cursor to ""; wait 3 seconds; unlock cursor
Code: Select all
lock cursor; set the cursor to EMPTY; wait 3 seconds; unlock cursor
I rarely use cursors lately, I used to use them frequently as a quick activity indicator ('set cursor to busy')
I do remember similar behaviors even going back to HyperCard days, and including with very own 'CursorDo XCMD' (circa 1994/95?, built with FutureBASIC, and includes an easter-egg: my special "New-F'ing-Jersey Cursor"). I always had to micro-manage the cursor with lock/unlock.
I added some 'lock cursor' AFTER your set cursors and it works as expected.
You got my cursor stuck as a tick or termite (or whatever that bug is, lol, good thing I had that line in my message box.
Here's modified version:
- richmond62
- Posts: 5288
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Curses
Thanks for the help.
To a certain extent that is my own stupidity as in my Devawriter Pro source stack I have a bespoke
cursor, but I implemented that about 12 years ago and then forgot how I did it.
To a certain extent that is my own stupidity as in my Devawriter Pro source stack I have a bespoke
cursor, but I implemented that about 12 years ago and then forgot how I did it.

https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2836
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Curses
Glad to help.richmond62 wrote: ↑Wed Aug 03, 2022 10:17 am Thanks for the help.
To a certain extent that is my own stupidity as in my Devawriter Pro source stack I have a bespoke
cursor, but I implemented that about 12 years ago and then forgot how I did it.![]()
Eventually I'd like to get back to my music sequencing oriented coding, long ago I had 16x16px cursors set up for various musical note lengths, set via a palette of note buttons (Whole Note, Half, Quarter, Q-Triplet, Eighth, etc.) for use in 'step-writing' music ('playSentence' strings). Most recently I was messing with cursors a little bit while working on oxtTools, mostly that stack uses edit/browse and the 'grab' hand, I'd like to add in a few Photoshop type cursors there. We have the PS move layer-mover cursor (our current 'edit' mode cursor), do we have the circle-target-crosshair (for pixel-color sampler)?
- OpenXTalkPaul
- Posts: 2836
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Curses
I added this stack to the web playground this morning and it doesn't work at all there, apparently there is zero cursor support in the Emscripten engine
? We can probably set cursor via JavaScript, but that would likely have to be a custom library handler, unless that could be quickly patched in to the standalone-community.9.6.3.js engine file (which may be possible in certain cases).

- OpenXTalkPaul
- Posts: 2836
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Curses
Adding the property <someTagElement element.style.cursor="move"> (for example) to DOM sets an HTML elements cursor within that element of the page, with javaScript you can do:
Which works for setting "move" cursor while the mouse is within the outer page, but NOT within our Emscripten 'canvas' area, nor inside of web playground's little console-text area (which obviously we want text handling cursors there anyway).
According to this web site: http://www.javascripter.net/faq/stylesc.htm
virtually all web browsers include the following built-in cursors:
auto
move
no-drop
col-resize
all-scroll
pointer
not-allowed
row-resize
crosshair
progress
e-resize
ne-resize
default
text
n-resize
nw-resize
help
vertical-text
s-resize
se-resize
inherit
wait
w-resize
sw-resize
So I guess we just need to use JS to get the Emscripten Engine's canvas element by ID or Name, so that we can set the cursor within our web stack(s) canvas area (which is your effective screenRect as far as the Emscripten engine is concerned). At least for these browser built-in cursors, but will do more research to see if we can get custom-cursors working with JS.
Code: Select all
document.body.style.cursor = "move";
According to this web site: http://www.javascripter.net/faq/stylesc.htm
virtually all web browsers include the following built-in cursors:
auto
move
no-drop
col-resize
all-scroll
pointer
not-allowed
row-resize
crosshair
progress
e-resize
ne-resize
default
text
n-resize
nw-resize
help
vertical-text
s-resize
se-resize
inherit
wait
w-resize
sw-resize
So I guess we just need to use JS to get the Emscripten Engine's canvas element by ID or Name, so that we can set the cursor within our web stack(s) canvas area (which is your effective screenRect as far as the Emscripten engine is concerned). At least for these browser built-in cursors, but will do more research to see if we can get custom-cursors working with JS.
- OpenXTalkPaul
- Posts: 2836
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Curses
This puts our canvas element into the variable targetCanvas:OpenXTalkPaul wrote: ↑Wed Aug 03, 2022 12:52 pm So I guess we just need to use JS to get the Emscripten Engine's canvas element by ID or Name, so that we can set the cursor within our web stack(s) canvas area (which is your effective screenRect as far as the Emscripten engine is concerned). At least for these browser built-in cursors, but will do more research to see if we can get custom-cursors working with JS.
Code: Select all
var targetCanvas = document.getElementById("canvas").getElementsByClassName("emscripten")[0];
.
..
...
....
This bit of JS works for changing the cursor, but then the Emscripten Engine crashes immediately after

Code: Select all
var canvas = document.getElementById('canvas');
canvas.setAttribute("style", "cursor: zoom-out");
- OpenXTalkPaul
- Posts: 2836
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Curses
OH! Of course so simple, this works for setting the cursor image in our Emscripten Engine
I tried a few things to get cursors working 'natively' to our xTalk engine (like adding revCursors.rev) but nothing worked.
But this works just fine. So the next thing would be to get custom cursors working, need to write a script that exports our xTalk 'native' cursor pixel maps into a base64 encoded data URL that we can then pass out to our JS instead of the standard web browser cursor names.
Code: Select all
document.getElementById("canvas").style.cursor = "zoom-in";
document.getElementById("canvas").style.cursor = "zoom-out";
document.getElementById("canvas").style.cursor = "arrow";
But this works just fine. So the next thing would be to get custom cursors working, need to write a script that exports our xTalk 'native' cursor pixel maps into a base64 encoded data URL that we can then pass out to our JS instead of the standard web browser cursor names.
- OpenXTalkPaul
- Posts: 2836
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Curses
So I wasted a bunch of time trying to get custom cursors (png,gif,svg, URLs, data URI, etc.) to work within the Emscripten canvas, with absolutely no luck. It seems Emscripten uses a JS port of Simple Direct Media Layer (SDL, which I have mentioned as a library to possibly wrap with Builder FFI bindings).
So I need to find some Emscripten_SDL example code for changing the cursor in SDL (or rather the Emscripten port of it).
https://wiki.libsdl.org/SDL_CreateCursor
That's a back burner thing I think, web stacks can use the CSS cursors for now. I have more interesting fish to fry.
So I need to find some Emscripten_SDL example code for changing the cursor in SDL (or rather the Emscripten port of it).
https://wiki.libsdl.org/SDL_CreateCursor
That's a back burner thing I think, web stacks can use the CSS cursors for now. I have more interesting fish to fry.
Who is online
Users browsing this forum: No registered users and 7 guests