menuPick doesn't fire if menu was dropped via "click at..."
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 234
- Joined: Thu Jul 01, 2010 11:50 am
menuPick doesn't fire if menu was dropped via "click at..."
I'm trying to make a data entry app on my Mac. If you've done data entry, you know that keyboard control is essential; productivity is slowed down dramatically if the user has to constantly waste time going back and forth between the keyboard and the mouse.
My idea is [field] tab >> [field] tab >> [field] >> tab [option menu] type text or use arrow keys, return >> [option menu] type or arrows, return
I get from the last text field to the first option menu with "on tabkey / click at the loc of btn Account1". That drops the menu nicely, but when I hit Return to select a menu item, "on menuPick" does not fire, so the second option menu does not drop. "on menuPick" fires just fine if I drop the menu with a human click on the menu, but of course, I'm trying to handle this from the keyboard.
I'm stumped. Any ideas?
My idea is [field] tab >> [field] tab >> [field] >> tab [option menu] type text or use arrow keys, return >> [option menu] type or arrows, return
I get from the last text field to the first option menu with "on tabkey / click at the loc of btn Account1". That drops the menu nicely, but when I hit Return to select a menu item, "on menuPick" does not fire, so the second option menu does not drop. "on menuPick" fires just fine if I drop the menu with a human click on the menu, but of course, I'm trying to handle this from the keyboard.
I'm stumped. Any ideas?
Re: menuPick doesn't fire if menu was dropped via "click at..."
Hi Michael,
hm, just made a quick test on my Mac with macOS 10.14.6 and LC 9.5:
One "option menu" button with this script:
So I can see if it works.
Then this in the card script:
Now when I hit TAB, I can select the menus with the arrow keys and when I hit ENTER or RETURN
I see the selected menuitem in the message box!
Not sure what is going wrong on your side? Can you please post the involved script(s)?
Best
Klaus
hm, just made a quick test on my Mac with macOS 10.14.6 and LC 9.5:
One "option menu" button with this script:
Code: Select all
on menuPick pItemName
put pItemName
end menuPick
Then this in the card script:
Code: Select all
on tabKey
click at the loc of btn 1
end tabKey
I see the selected menuitem in the message box!
Not sure what is going wrong on your side? Can you please post the involved script(s)?
Best
Klaus
-
- Posts: 234
- Joined: Thu Jul 01, 2010 11:50 am
Re: menuPick doesn't fire if menu was dropped via "click at..."
Thank you very much for the quick reply.
Okay, I stand corrected: menuPick does indeed fire when an item is selected via the keyboard. However, the second option menu just won't drop.
The "wait 1 milliseconds" is because even when choosing the menu item with the mouse, the next option menu won't pop unless I put in the delay.
I thought maybe with a keyboard selection I might just have to wait longer, but waiting even 5 seconds doesn't drop the second menu.
I do see "the seconds" populated in the message box.
So, the problem isn't that menuPick isn't firing, it's that the second menu is prejudiced against keyboard input on the first menu.
Okay, I stand corrected: menuPick does indeed fire when an item is selected via the keyboard. However, the second option menu just won't drop.
Code: Select all
on menuPick
wait 1 milliseconds # Next menu doesn't pop unless we wait
click at the loc of btn Account2_
put the seconds
end menuPick
I thought maybe with a keyboard selection I might just have to wait longer, but waiting even 5 seconds doesn't drop the second menu.
I do see "the seconds" populated in the message box.
So, the problem isn't that menuPick isn't firing, it's that the second menu is prejudiced against keyboard input on the first menu.
Re: menuPick doesn't fire if menu was dropped via "click at..."
Hi Michael,
ah, get it!
Yep, same here, nothing pops up after the first option menu.
No idea why this is so, but here a workaround, just put the popping of the next menu
into an extra handler and SEND it with a little delay.
This does work for the optionmenu buttons:
Hint: Get used to put QUOTES around names of objects!
Best
Klaus
ah, get it!
Yep, same here, nothing pops up after the first option menu.
No idea why this is so, but here a workaround, just put the popping of the next menu
into an extra handler and SEND it with a little delay.
This does work for the optionmenu buttons:
Code: Select all
## Optionmenu 1 in my example
on menuPick pItemName
put pItemName
send "nextmenu" to me in 1 millisecs
end menuPick
## This will also go into this button:
## No idea why, but it does work reliably! :-)
command nextmenu
click at the loc of btn "my option 2"
end nextmenu
Code: Select all
...
## click at the loc of btn Account2_
click at the loc of btn "Account2_"
...
Klaus
-
- Posts: 234
- Joined: Thu Jul 01, 2010 11:50 am
Re: menuPick doesn't fire if menu was dropped via "click at..."
Thank you, Klaus. You saved my project!