Page 3 of 3
Re: Simulate keypress in a script
Posted: Sun Dec 23, 2018 7:10 pm
by richmond62
if one does this in a cardScript:
Code: Select all
on rawKeyUp PP
put PP
end rawKeyUp
one ends up with 65363 in the messageBox
this is the code the operating system uses for the right arrow key
However, it is also a Unicode glyph address (0xFF53):
http://www.unicode.org/charts/PDF/UFF00.pdf
and this is why an 's' gets dumped in a field when one does this sort of thing:
this
inserts "arrowKey right" at an insertion point
and
does nothing
Re: Simulate keypress in a script
Posted: Sun Dec 23, 2018 7:13 pm
by dunbarx
I think Richard or Klaus should move this thread to "Talking Livecode". It is not a feature request, per se, though I bet the OP wishes it were.
Craig
Re: Simulate keypress in a script
Posted: Sun Dec 23, 2018 7:16 pm
by richmond62
At the very start of the Unicode "thang" there are lots of what are called 'control characters'
(which I cannot understand). I suppose one of the ways to send and/or type
what an arrowKey right does is to find out which control character
in the Unicode set does this . . .
-

- altKey state.png (7.01 KiB) Viewed 4472 times
-
my pseudoCode would do this:
put the altKey into right
and then something like this:
https://www.alt-codes.net/arrow_alt_codes.php
What I mean, is somehow set the stack to see the altKey as Down.
Re: Simulate keypress in a script
Posted: Sun Dec 23, 2018 8:29 pm
by richmond62
What, perhaps, should be pointed out, is that as LiveCode is (at least partly) cooked in C++
there are ways to fake arrow keys in C++
VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT
which, presumably, could be rolled into LiveCode without undue fuss.
Re: Simulate keypress in a script
Posted: Sun Dec 23, 2018 9:11 pm
by richmond62
One of the snags here is that, while in
javaScript and so on one can play around with
the
keycode of a key on a keyboard, and find out that the keycode for the left arrowKey is 37, and the right arrowKey is 39, and then make use of that information, I for one cannot work out how one might do that in LiveCode.
-

- keycodes.png (16.17 KiB) Viewed 4453 times
-
LiveCode, frustratingly, mentions this:
-
-
but then lets one down with a damp squib.
Re: Simulate keypress in a script
Posted: Sun Dec 23, 2018 9:37 pm
by richmond62
Part of this discussion is
-

- old hat.jpg (4.09 KiB) Viewed 4448 times
-
old hat
-
https://www.mail-archive.com/use-liveco ... 28081.html