setting the focus with keyboard property on a field

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
mvillion
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 91
Joined: Sun Feb 24, 2013 12:29 pm

setting the focus with keyboard property on a field

Post by mvillion » Sat Jun 09, 2018 11:41 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5569
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: setting the focus with keyboard property on a field

Post by dunbarx » Sun Jun 10, 2018 1:20 am

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

mvillion
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 91
Joined: Sun Feb 24, 2013 12:29 pm

Re: setting the focus with keyboard property on a field

Post by mvillion » Sun Jun 10, 2018 10:12 am

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

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2240
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: setting the focus with keyboard property on a field

Post by jmburnod » Sun Jun 10, 2018 11:48 am

Hi,
I want to toggle it via a script but I cannot find the 'property name' to be able to address it.
I think you look for traversalOn
Best regards
Jean-Marc

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2732
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: setting the focus with keyboard property on a field

Post by richmond62 » Sun Jun 10, 2018 3:44 pm

Code: Select all

on mouseUp
   focus on fld "ff1"
end mouseUp
fff.png
Focus.livecode.zip
(990 Bytes) Downloaded 37 times
OK, OK: that's with a mouseClick rather than a keyboard initiator . . .

Code: Select all

on keyDown KD
if KD = "q" then
focus on fld "ff1"
end if
end keyDown

Klaus
Posts: 10381
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: setting the focus with keyboard property on a field

Post by Klaus » Sun Jun 10, 2018 4:22 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4658
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: setting the focus with keyboard property on a field

Post by jacque » Sun Jun 10, 2018 4:48 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5569
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: setting the focus with keyboard property on a field

Post by dunbarx » Sun Jun 10, 2018 11:26 pm

Oh, You really meant "focus with keyboard".

Why didn't you say so? :wink:

It has been so long since I ever used the "human readable" labels that I never made the connection.

Craig

mvillion
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 91
Joined: Sun Feb 24, 2013 12:29 pm

Re: setting the focus with keyboard property on a field

Post by mvillion » Sun Jun 10, 2018 11:40 pm

Wow.

I feel like a complete NOOB.

Hover over label to get the value. Doh!

Many thanks

bogs
Posts: 2276
Joined: Sat Feb 25, 2017 10:45 pm

Re: setting the focus with keyboard property on a field

Post by bogs » Mon Jun 11, 2018 3:14 am

mvillion wrote:
Sun Jun 10, 2018 11:40 pm
Wow. I feel like a complete NOOB.
Exhilarating isn't it? I feel that way every 3rd or 4th time I start a project... :D
Image

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4658
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: setting the focus with keyboard property on a field

Post by jacque » Mon Jun 11, 2018 5:31 am

bogs wrote:
Mon Jun 11, 2018 3:14 am
mvillion wrote:
Sun Jun 10, 2018 11:40 pm
Wow. I feel like a complete NOOB.
Exhilarating isn't it? I feel that way every 3rd or 4th time I start a project... :D
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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2732
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: setting the focus with keyboard property on a field

Post by richmond62 » Mon Jun 11, 2018 7:38 am

I feel like a complete NOOB.
Continuously since my first contact with HyperCard in 1993. 8)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5569
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: setting the focus with keyboard property on a field

Post by dunbarx » Mon Jun 11, 2018 2:58 pm

Continuously since my first contact with HC in 1987.

Craig

bogs
Posts: 2276
Joined: Sat Feb 25, 2017 10:45 pm

Re: setting the focus with keyboard property on a field

Post by bogs » Mon Jun 11, 2018 3:27 pm

At least we're in good company eh, mvillion :wink:
Image

Post Reply

Return to “Mac OS”