Can I tab text in a field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Can I tab text in a field
I'd like to enter text in a field and be able to type tabs to add basic tab structure. I have a field with tabStops set and it works perfectly in LC, but of course when I try and enter text in the browser version, hitting the tab key tabs out of the field. Any ideas?
k
ADDED CLARIFICATION: this is in the HTML5 output. It works jes' fine in LC, just not in the HTML5 'app'
k
ADDED CLARIFICATION: this is in the HTML5 output. It works jes' fine in LC, just not in the HTML5 'app'
Last edited by thatkeith on Thu Apr 26, 2018 11:20 pm, edited 1 time in total.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Can I tab text in a field
Code: Select all
on tabKey
put tab into the selection
end tabKey
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Can I tab text in a field
Hmm. Tried it in the field script and I'm afraid it doesn't work. :-/
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Can I tab text in a field
Here's a thought:
Code: Select all
on tabKey
put (numToCodePoint(32) && numToCodePoint(32) && numToCodePoint(32)) into the selection
end tabKey
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Can I tab text in a field
That is a strange anomaly; I've used that snippet at least a hundred times over the years.
Which LC version, and which OS?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Can I tab text in a field
Well in 6.5 (linux) it "works", but I had to hit the tab key twice for it to go. In 7, same thing, although it seemed a bit random (sometimes it went, sometimes it was just a space on the first tabKey), and in 8.1.4 it didn't go no matter how many times I hit the tab key. Just for grins, I tested it back to Mc 2.5, usually you got the tab on the second tabKey.
I put the code directly into the fields script, is it supposed to be elsewhere?
I put the code directly into the fields script, is it supposed to be elsewhere?
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Can I tab text in a field
LC 9.0 RC 1, Mac OS 10.13.4, Safari 11.1.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Can I tab text in a field
Remember this is HTML5 output in a browser, generated from LC 9 in the latest Safari on Mac. Hitting the tab key cycles the focus between the field in the LC HTML5 app, something unclear (the main page?), and the browser's address field.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Can I tab text in a field
Nice. Although I need actual tabs rather than tabs simulated with spaces, and it doesn't work in the browser environment anyway. I also tried numToCodePoint(9) to attempt to script the insertion of a tab, and numToCodePoint(35) to insert a hash and then replace that with tab. Anything I do is scuppered by the tab key event being caught by the browser and used to switch focus rather than insert a character, no matter what works as expected in LC itself.richmond62 wrote: ↑Thu Apr 26, 2018 9:32 pmHere's a thought:
Code: Select all
on tabKey put (numToCodePoint(32) && numToCodePoint(32) && numToCodePoint(32)) into the selection end tabKey
I hope there's a workaround and I hope it's possible to bring the HTML5 output more in line with the other outputs in future. :-/
k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Can I tab text in a field
Sounds like the browser is eating the tab keyboard message. May warrant a bug report.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Can I tab text in a field
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Can I tab text in a field
Dunno if, by trapping the rawKey code for the TAB key (err . . . might not work on a Mac), you
can pre-empt the TAB key:
Come to think of things it might be better to use rawKeyDown to ensure that gets "there" first.
can pre-empt the TAB key:
Code: Select all
on rawKeyUp RUP
if RUP = 65289 then
put tab into the selection
else
pass rawKeyUp
end if
end rawKeyUp
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Can I tab text in a field
Nice try, but the browser wins. :-/
It doesn't even tab through available fields in the card; it jumps straight out to some invisible browser focus on the first tab, then to the address bar on the second, then back to the point where the cursor was in the original LC card field on the third.
It's something that does need fixing. For now I can see no workaround.
It doesn't even tab through available fields in the card; it jumps straight out to some invisible browser focus on the first tab, then to the address bar on the second, then back to the point where the cursor was in the original LC card field on the third.
It's something that does need fixing. For now I can see no workaround.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Can I tab text in a field
This will be, even for some modifier keys, always be an unsolved problem with the HTML5 standalone builder because different browsers will have different precedence settings for special keys.
Until now you can't even use modifier-clicks with the HTML5 standalone builder. Or use in a control's script "if the shiftkey is down".
As a workaround for your current problem you could write "\t" in your field "myField" and then by some other action that works in all browsers, for example via a button, fire
Until now you can't even use modifier-clicks with the HTML5 standalone builder. Or use in a control's script "if the shiftkey is down".
As a workaround for your current problem you could write "\t" in your field "myField" and then by some other action that works in all browsers, for example via a button, fire
Code: Select all
replace "\t" with tab in field "myField"
shiftLock happens