LC doesn't allow scripts to override its own messages, unlike HC, but that's a different thing. Are there other keywords that can't be "sent"? If so, then it's apparently intentional for some reason. If not, then it might be worth a mention.dunbarx wrote:Do you think this is worth mentioning? I have always been comforted by believing that an xTalk IDE was so flexible and accessible that, generically, " being able to invoke an arrowKey message under script control" was, simply, doable.
Did I mention that other instances of that pipe dream required kluges?
Simulate key press
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Simulate key press
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Simulate key press
As far as I can see the reason why it doesn't seem possible to invoke an arrowKey signal via script is
because, unlike a mouseDown the thing consists of 2 components:
It might (?) be an idea to submit an enhancement request of this sort:
send "arrowKey"("up")
because, unlike a mouseDown the thing consists of 2 components:
It might (?) be an idea to submit an enhancement request of this sort:
send "arrowKey"("up")
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Simulate key press
Come to think of things, a series of this sort would be useful:
send "keyUp"("r")
send "rawKeyUp"(114)
send "keyUp"("r")
send "rawKeyUp"(114)
Re: Simulate key press
Try the "type" command?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Simulate key press
I tried type.
and wondered how I would get the buttonScript to type "Аз харесам кашкавал"
by sending rawKey codes and having a Bulgarian keyboard layout selected on my computer.
This kind of banal and obvious script:
and
(Having checked that script: it does NOT work)
>>> work (and kudos to the Livecode people for everything working in a straightforward way
with a non-Latin writing system). <<<
How do I type the arrowKey "down"?
and wondered how I would get the buttonScript to type "Аз харесам кашкавал"
by sending rawKey codes and having a Bulgarian keyboard layout selected on my computer.
This kind of banal and obvious script:
and
(Having checked that script: it does NOT work)
>>> work (and kudos to the Livecode people for everything working in a straightforward way
with a non-Latin writing system). <<<
How do I type the arrowKey "down"?
Last edited by richmond62 on Tue Jul 19, 2016 7:36 pm, edited 1 time in total.
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Simulate key press
To explain in a little more detail:
Here's a cardScript:
on arrowKey AX
switch AX
case "up"
--do procedure #1
break
case "down"
--do procedure #2
break
end switch
end arrowKey
Now; how could I have a button which contains this sort of (pseudocode):
on mouseUp
send "arrowkey"("up") to card id 2001
end mouseUp
and, similarly with rawKey values?
Here's a cardScript:
on arrowKey AX
switch AX
case "up"
--do procedure #1
break
case "down"
--do procedure #2
break
end switch
end arrowKey
Now; how could I have a button which contains this sort of (pseudocode):
on mouseUp
send "arrowkey"("up") to card id 2001
end mouseUp
and, similarly with rawKey values?
Re: Simulate key press
I wouldn't think you need to send an arrowkey message at all. Just separate the actions from the handlers:
Or you could combine them:
Code: Select all
on arrowKey AX
switch AX
case "up"
procedure!
break
case "down"
procedure2
break
end switch
end arrowKey
on mouseUp
procedure1
end mouseUp
on procedure1
-- stuff
end proceudre1
on procedure2
--stuff
end proceudre2
Code: Select all
on procedure pNum
switch pNum
case 1
-- procedure 1 stuff
break
case 2
-- procedure 2 stuff
break
end switch
end proedure
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com