setting the focus with keyboard property on a field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
setting the focus with keyboard property on a field
Hi
I am trying to set the 'focus with keyboard' property of a field via a script but I cannot find out how.
It is available in the properties but I cannot find it in the dictionary for fields properties.
Any ideas people?
thanks
Matt
I am trying to set the 'focus with keyboard' property of a field via a script but I cannot find out how.
It is available in the properties but I cannot find it in the dictionary for fields properties.
Any ideas people?
thanks
Matt
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: setting the focus with keyboard property on a field
Hi.
Do you mean something like tabbing from one field to another? That action does indeed involve the keyboard.
Or you might use the "keyDown" or "rawKeyDown" messages (or their cousins) to send a message giving focus to the next field in the tabbing order (or any other field at all, for that matter)
Is that what you meant?
Craig Newman
Do you mean something like tabbing from one field to another? That action does indeed involve the keyboard.
Or you might use the "keyDown" or "rawKeyDown" messages (or their cousins) to send a message giving focus to the next field in the tabbing order (or any other field at all, for that matter)
Is that what you meant?
Craig Newman
Re: setting the focus with keyboard property on a field
Ok.
Set up a stack.
Place a field
Look at the properties of a field. There is a property called 'focus with keyboard'.
This allows the keyboard to focus on the field so things can be typed into it (or not)
Sometimes I want to allow it. Other times I don't.
I want to toggle it via a script but I cannot find the 'property name' to be able to address it.
Thanks
Set up a stack.
Place a field
Look at the properties of a field. There is a property called 'focus with keyboard'.
This allows the keyboard to focus on the field so things can be typed into it (or not)
Sometimes I want to allow it. Other times I don't.
I want to toggle it via a script but I cannot find the 'property name' to be able to address it.
Thanks
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: setting the focus with keyboard property on a field
Hi,
Best regards
Jean-Marc
I think you look for traversalOnI want to toggle it via a script but I cannot find the 'property name' to be able to address it.
Best regards
Jean-Marc
https://alternatic.ch
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: setting the focus with keyboard property on a field
Code: Select all
on mouseUp
focus on fld "ff1"
end mouseUp
Code: Select all
on keyDown KD
if KD = "q" then
focus on fld "ff1"
end if
end keyDown
Re: setting the focus with keyboard property on a field
Hi Matt,
good advice: Open the LC preferences, on the "General" part check -> Property Labels are -> Name of LiveCode properties
Now the inspector will show the names of the properties as used for scripting instead of their "human readable" expalantion.
Best
Klaus
good advice: Open the LC preferences, on the "General" part check -> Property Labels are -> Name of LiveCode properties
Now the inspector will show the names of the properties as used for scripting instead of their "human readable" expalantion.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: setting the focus with keyboard property on a field
One of the first things I tell new users is to do what Klaus suggested. Regardless of which setting you use though, hovering over the label will show a tooltip that gives you the alternate information.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: setting the focus with keyboard property on a field
Oh, You really meant "focus with keyboard".
Why didn't you say so?
It has been so long since I ever used the "human readable" labels that I never made the connection.
Craig
Why didn't you say so?
It has been so long since I ever used the "human readable" labels that I never made the connection.
Craig
Re: setting the focus with keyboard property on a field
Wow.
I feel like a complete NOOB.
Hover over label to get the value. Doh!
Many thanks
I feel like a complete NOOB.
Hover over label to get the value. Doh!
Many thanks
-
- VIP Livecode Opensource Backer
- Posts: 7229
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: setting the focus with keyboard property on a field
LOL. You would not believe the dumb thing I did last night. Two hours debugging something that wasn't even broken because I overlooked the obvious. Twice.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: setting the focus with keyboard property on a field
Continuously since my first contact with HyperCard in 1993.I feel like a complete NOOB.
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: setting the focus with keyboard property on a field
Continuously since my first contact with HC in 1987.
Craig
Craig
Re: setting the focus with keyboard property on a field
At least we're in good company eh, mvillion
Re: setting the focus with keyboard property on a field
I just had exactly mvillion's question.
I'm appalled at the number of answers that simply do not address the very clearly stated question: how does one set the focus with keyboard from a script? For example, dunbarx obviously can't read that, but he is not the only one. This sort of well-meaning, fast response that is completely off the mark is very typical of programming forums. Stack Overflow is full of them, so are all the others and this one is no exception. Sigh. (nothing against dunbarx in particular, he just happened to be the first one encountered, sorry that you happen to function as my example)
As jmburnod answered, it's not possible to set focus with keyboard because the property is actually called traversalon. Thanks Jean-Marc.
I too have set the LiveCode preference to show property labels as name of property, not description of option. But that seemingly does not work: the property inspector still gives wrong information.
The IDE is so full of small bugs that I despair. I've been using Hypercard from 1985, until I discovered runrev in 2000 and have been a LiveCode/RuntimeRevolution user ever since. I would not know what to do without LiveCode.
But I sincerely hope that instead of rushing into the next feature development, the LiveCode team will take a year or so to fix the literally hundreds of annoying small bugs that make development highly irritating. Any first-time user trying out LiveCode will hit these problems, finally give up, and never come back.
The solution to mvillion's problem is indeed to set traversalon to true/false
Bye guys, have a nice day.
I'm appalled at the number of answers that simply do not address the very clearly stated question: how does one set the focus with keyboard from a script? For example, dunbarx obviously can't read that, but he is not the only one. This sort of well-meaning, fast response that is completely off the mark is very typical of programming forums. Stack Overflow is full of them, so are all the others and this one is no exception. Sigh. (nothing against dunbarx in particular, he just happened to be the first one encountered, sorry that you happen to function as my example)
As jmburnod answered, it's not possible to set focus with keyboard because the property is actually called traversalon. Thanks Jean-Marc.
I too have set the LiveCode preference to show property labels as name of property, not description of option. But that seemingly does not work: the property inspector still gives wrong information.
The IDE is so full of small bugs that I despair. I've been using Hypercard from 1985, until I discovered runrev in 2000 and have been a LiveCode/RuntimeRevolution user ever since. I would not know what to do without LiveCode.
But I sincerely hope that instead of rushing into the next feature development, the LiveCode team will take a year or so to fix the literally hundreds of annoying small bugs that make development highly irritating. Any first-time user trying out LiveCode will hit these problems, finally give up, and never come back.
The solution to mvillion's problem is indeed to set traversalon to true/false
Bye guys, have a nice day.
The Old Rant Robert.