not possible to set focus on option lists?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

not possible to set focus on option lists?

Post by billworld » Wed Oct 29, 2008 8:48 pm

I really need to be able to tab into option list fields. I don't see an option to set these controls as "focusable" and attempts to set traversalOn to force the issue haven't worked yet.

Also, all throughout the RR interface option lists are not accessible to keyboard tabbed entry.

All this is leading me to believe that for some odd reason tabbing into option list controls is not supported in RR.

Please tell me this isn't true. This is basic required functionality for my app.!

Note: I'm on Mac OS X and have my keyboard prefs. set to allow tabbing into UI elements. Works great in Web browsers, etc. Need for this to work in RR.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Oct 29, 2008 11:30 pm

Hi Bill,

When I type tab, I see the focus of fields change. So, I'm not sure what problem you are having here.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Thu Oct 30, 2008 3:47 am

Are you able to tab type into an option list (or pop up list, etc.) control?
Mark wrote:Hi Bill,

When I type tab, I see the focus of fields change. So, I'm not sure what problem you are having here.

Best,

Mark

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Oct 30, 2008 7:06 am

Hi Bill,

This is unfortunately a known limitation, reported in this Quality Center entry

Until they get around to introducing this, you could switch to a combobox and provide 'type-ahead' autocompletion while ensuring correct data entry with this simple script:

Code: Select all

on keyDown pKey
   put the text of me into tItemList
   put the label of me into tLabel
   put the selectedChunk into tSelectedChunk
   put word 2 of tSelectedChunk into tSelectionStart
   put word 4 of tSelectedChunk into tSelectionEnd
   put tSelectionStart > tSelectionEnd into tInsertingFlag
   if tInsertingFlag then
      -- inserting a new character between two characters
      put char 1 to tSelectionEnd of tLabel & pKey & char tSelectionStart to -1 of tLabel into tSearchText
   else
      -- replacing a selection with a new character
      put char 1 to tSelectionStart - 1 of tLabel & pKey & char tSelectionEnd + 1 to -1 of tLabel into tSearchText
   end if
   put lineOffset(tSearchText, tItemList) into tLineOffset
   if tLineOffset = 0 then
      -- block the typing
      beep
   else
      -- we have a match
      set the label of me to line tLineOffset of tItemList
      if tInsertingFlag then
         select char tSelectionStart to -1 of me
      else
         select char tSelectionStart + 1 to -1 of me
      end if
   end if
end keyDown
HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Oct 30, 2008 10:38 am

Hi Bill,

You referred to a list field, but apparently you mean an option menu button. Indeed, it seems to be imposible to get focus on such an object without using the mouse.

I have just tried to set the modifierKeys and acceleratorKey of an option menu button. I also tried a normal button. Can anyone confirm that this doesn't work on Mac OS X (Rev 3.0)?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Thu Oct 30, 2008 1:07 pm

Still trying to understand nomenclature on this platform. Other apps. refer to objects which take an option menu as a field type. I'm now understanding it's referred to as a button here. Thanks for pointing this out. (And, now I do see where the "button" reference is found in the title bard of the Prop. Inspec. palette as well as the icon in the App. Browser.)

Anyway, in RR we need the ability to tab into fields and buttons. This is pretty important and standard with UIs, so, I'm quite surprised to learn RR doesn't supported tabbing into buttons. Maybe because in the past this wasn't an option on Macs?
Mark wrote:Hi Bill,

You referred to a list field, but apparently you mean an option menu button. Indeed, it seems to be imposible to get focus on such an object without using the mouse.

I have just tried to set the modifierKeys and acceleratorKey of an option menu button. I also tried a normal button. Can anyone confirm that this doesn't work on Mac OS X (Rev 3.0)?

Best,

Mark

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Thu Oct 30, 2008 1:57 pm

On OS X, you can't tab to a button by default. Some browsers don't adhere to that for their forms, or allow you to enable the Windows style behaviour.

I thought it was possible to set a buttons properties to allow for that in Rev, but I was unable to do it on a quick try. Of course tabbing between fields is no problem, and enabled by default.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Thu Oct 30, 2008 5:19 pm

FWIW if it makes you feel any better, I can't get Option buttons to work properly by keyboard on Windows, either.
The focus works, and using arrow keys to navigate up and down the list works, but there's no way of selecting a menu choice from the options without using the mouse.
I have tried using on enterKey, on returnKey, on enterInField, on returnInField, on rawKeyUp to catch the selected item and "send menuPick" to the button.
The best success I have had is with rawKeyUp catching the enter code number, but even with a "focus on" statement everything just hangs until the mouse is clicked on some other object that takes focus. Tabbing or entering seems not to work to trigger the menuPick properly.

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Thu Oct 30, 2008 5:38 pm

Thanks for chiming in. Definitely is lacking functionality in RR. For apps that rely heavily on data entry (such as mine) and for RR to compete in that category with the likes of FileMaker Pro and others, RR really needs to allow entry and selection within option menu "buttons" and other UI controls/buttons.
SparkOut wrote:FWIW if it makes you feel any better, I can't get Option buttons to work properly by keyboard on Windows, either.
The focus works, and using arrow keys to navigate up and down the list works, but there's no way of selecting a menu choice from the options without using the mouse.
I have tried using on enterKey, on returnKey, on enterInField, on returnInField, on rawKeyUp to catch the selected item and "send menuPick" to the button.
The best success I have had is with rawKeyUp catching the enter code number, but even with a "focus on" statement everything just hangs until the mouse is clicked on some other object that takes focus. Tabbing or entering seems not to work to trigger the menuPick properly.

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Thu Oct 30, 2008 5:56 pm

I've just done a fudge to try this again on Windows, and I can tab into the option list and select a line with the arrow keys.
Now I have put a script in the option button

Code: Select all

on returnKey
   local tText
   put the selectedText of me into tText
   send "menuPick tText" to me
   click at -100,-100
   focus on field "nextField"
end returnKey
That seems to force it to "lose focus" and do the menuPick action for the button. So a fudgy workaround is at least possible on Windows. I gather Mac OS cannot even use the keyboard to focus on the object in the first place? That really is a hindrance - as input methods are a vital factor in placement of software, as the QCC report states, and I'm shocked to see this was raised in 2004 with no apparent development in that area.
Is there any way you could fudgily workaround simulating the button with scripted clicks?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Thu Oct 30, 2008 7:17 pm

Just to note, that on Mac OS X, buttons and menus just never get keyboard focus (there is a setting somewhere to enable it for accessibility cause I think). This is just the Mac way. Of course one could fake the menu itself within Rev, but then it won't be in the native appearance.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Thu Oct 30, 2008 7:50 pm

The setting you're referring to is System Preferences/Keyboard & Mouse/Keyboard Shortcuts/Keyboard Navigation/

It's pretty powerful having it on.

Regardless, this thing doesn't even work on Windows as it should. So, it needs to be fixed. And, might as well make it work on Macs for those power users who turn full Keyboard Navigation on.
BvG wrote:Just to note, that on Mac OS X, buttons and menus just never get keyboard focus (there is a setting somewhere to enable it for accessibility cause I think). This is just the Mac way. Of course one could fake the menu itself within Rev, but then it won't be in the native appearance.

Post Reply