Scripting tab
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Scripting tab
How does one write a script to effect the pressing of the tab key? The dictionary seems to indicate it can't be done, but there must be some workaround.
Thanks,
Dave
Thanks,
Dave
Re: Scripting tab
I think maybe separating the code that does the action you expect into a separate handler, then you can call it in code as well as trap the tab key on rawKeyDown...
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Scripting tab
How about seeing if the TAB key will give you a rawKey signal?
Re: Scripting tab
Hi Dave,
this is what you are looking for:
Best
Klaus
this is what you are looking for:
Code: Select all
...
## do this
## do that
type TAB
...

Best
Klaus
Re: Scripting tab
What Klaus said, I think.
How and why do you need to, as you say, "press" the tab key? To insert it (ASCII 9) in a string? To invoke some keyboard combination? To have that key invoke some process?
Craig
How and why do you need to, as you say, "press" the tab key? To insert it (ASCII 9) in a string? To invoke some keyboard combination? To have that key invoke some process?
Craig
Re: Scripting tab
Richmond.
All keys give return a value, except for "capsLock", "Shift", "Control", "Option", "Command" and "fn".
Craig
Sure, "65289"How about seeing if the TAB key will give you a rawKey signal?
All keys give return a value, except for "capsLock", "Shift", "Control", "Option", "Command" and "fn".
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Scripting tab
I knew that, but I have a feeling that getting newbies to do the odd thing by themselvesSure, "65289"
rather than too much spoon feeding might be pedagogically not such a bad idea.
-The dictionary seems to indicate it can't be done
Re: Scripting tab
Be careful.
Jacque might get on your case as she has done on mine. Whatever you, do not call it "homework".
Craig
Jacque might get on your case as she has done on mine. Whatever you, do not call it "homework".
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Scripting tab
Never knowingly done that before.Be careful.

Last edited by richmond62 on Fri Feb 04, 2022 7:09 pm, edited 1 time in total.
Re: Scripting tab
Hi @dsquance
Look this up in the "tabKey" dictionary
Isn't that what you mean?
taken from the LC dictionary
Code: Select all
on tabKey -- go forward in stack on tab, backward on shift-tab
if the shiftKey is down then go previous card
else go next card
end tabKey
Be kind, we all have our own wars.
https://torocruzand.com/
https://torocruzand.com/
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Scripting tab
Wait a moment:
probably more like this:
- -
And while Craig may be smirking at trapping me into stating that the Unicode for TAB is 65289 I went to the trouble of
checking that, and 65289 is some sort of parenthesis, while the Unicode for TAB is simply '9'.
And while I am here perhaps I should point out that my 'TAB' is not amused and has stumped off to do some yoga:
-
does not want a tabKey thing,How does one write a script to effect the pressing of the tab key?
probably more like this:
- -
And while Craig may be smirking at trapping me into stating that the Unicode for TAB is 65289 I went to the trouble of
checking that, and 65289 is some sort of parenthesis, while the Unicode for TAB is simply '9'.
And while I am here perhaps I should point out that my 'TAB' is not amused and has stumped off to do some yoga:
-
- Attachments
-
- TABBY CAT.livecode.zip
- Here's the stack.
- (1.08 KiB) Downloaded 140 times
Re: Scripting tab
I took it to mean that <tab> in this case would trigger an action (which could be to insert a tab character or could be something else), and that the OP wanted to trigger this without hitting the tab key - hence i suggested splitting the action into a separate handler that could be called in code and can also be linked to the tab key being pressed (ie sent from on tabKey or on rawKeyDown).
I guess the OP needs to provide a bit more clarity...
I guess the OP needs to provide a bit more clarity...
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Scripting tab
You are quite right.I guess the OP needs to provide a bit more clarity.
Re: Scripting tab
How did you know I was smirking?And while Craig may be smirking at trapping me into stating that the Unicode for TAB is 65289 I went to the trouble of
checking that, and 65289 is some sort of parenthesis, while the Unicode for TAB is simply '9'.
The ASCII value for "tab" is 9. The value returned for tab via "RawKeyWhatever" is 65289. Tab does not return a value, ASCII or whatever, for "keyDown".
I do not think unicode enters into any of this.
Craig
Re: Scripting tab
I guess I needed to be specific. I want a tab action, not a tab in the sense of spacing. My intention is to allow text entry from a screen "keyboard" by clicking on a letter which puts the letter into a field and then the cursor should move to the next field as it would if the tab key were pressed.
But thanks to all who have weighed in.
Dave
But thanks to all who have weighed in.
Dave