Page 1 of 1

minor glitch with accelerator keys

Posted: 20 Oct 2010 21:44
by Joso
Little glitch - let's see if I can explain it briefly and clearly.

I can invoke the following script in two ways: (never mind what it does - just an example)

"&All"
#250
"&Files"
#255
"&None"
#251

- First by assigning it to a User Button on the toolbar
- Second by running the script from User-Defined Commands and assigning a keyboard shortcut to it

NOW: - when I invoke the script by clicking the toolbar icon - the drop-down menu appears WITHOUT the accelerator keys underlined. BUT IF invoked from UDC with the keyboard shortcut, the accelerator keys ARE underlined. How come?

(aside - all of the drop-down toolbar items appear to have accelerator keys associated with the sub-menu items, but there is no way to see which key is assigned to which option without the underscore)

Re: minor glitch with accelerator keys

Posted: 20 Oct 2010 22:03
by SkyFrontier
Similar problems:
-Key accelerators not being displayed on script menus (reported here, not working on 9.60.0009 but seems to be ok with newest beta, .0101).
-Regarding "Cancel" on script menus: if I add the keyboard accelerator the menu item is grayed and not click-able; if I remove the key-accel. I can click it but (of course!) losing the functionality. (reference here)
-If it happens that the key accelerator is the same as the key combo component used to invoke it, XY will pop a notice telling about it and do nothing.

Re: minor glitch with accelerator keys

Posted: 20 Oct 2010 22:06
by TheQwerty
This is controlled by Windows, and they should be visible if you press the alt key.

You can change this in XP:
1) Open Control Panel
2) Open Display Properties
3) Select Appearance Tab
4) Open Effects
5) Uncheck: "Hide underlined letters for keyboard navigation until I press the Alt key"

This might be correct for Vista and 7 (I cannot verify it now though): http://www.vistax64.com/vista-general/4 ... ators.html

Re: minor glitch with accelerator keys

Posted: 20 Oct 2010 22:11
by TheQwerty
SkyFrontier wrote:-Regarding "Cancel" on script menus: if I add the keyboard accelerator the menu item is grayed and not click-able; if I remove the key-accel. I can click it but (of course!) losing the functionality. (reference here)
This is because you're using an empty script to cancel. Read up on the End command.

Also you can test this to see the differences:

Code: Select all

"Cancel"
"&Cancel"
"Cancel"	end True;
"&Cancel"	end 1;
EDIT: End doesn't really need a condition, but if the script has been called by another script that will do more after the script is called it might actually be the goal of this Cancel to kill the whole script.

Re: minor glitch with accelerator keys

Posted: 20 Oct 2010 22:45
by SkyFrontier
Thank you for the valuable tips, TheQwerty!
-even the .0009 is displaying everything as expected ("cancel", key-accels.).
Just need to test (later) the key-combo issue (perhaps a feature?).

Re: minor glitch with accelerator keys

Posted: 23 Oct 2010 21:42
by Joso
TheQwerty wrote:This might be correct for Vista and 7 (I cannot verify it now though): http://www.vistax64.com/vista-general/4 ... ators.html
(just in case someone else ever comes across this thread)

Here's the Win 7 procedure:

go to Control Panel,
click Ease of Access
click Ease of Access Center
click Make the keyboard easier to use
select the Underline keyboard shortcuts and access keys check box.

Re: minor glitch with accelerator keys

Posted: 27 Oct 2010 01:49
by SkyFrontier
Variant of the problem:
if a script is launched from Run Script..., it'll not display the accel. keys. Pushing ALT will make the menu disappear. Any workaround for this...?
For the records, using ::load 'script' will pop the menu correctly, ie, showing the assigned accel. keys.