Page 1 of 1

Add indications for hotkeys

Posted: 06 Apr 2012 21:17
by paul0
I customized toolbar button using the script below:

Code: Select all

"&Breadcrumb|icons\breadcrumb.ico" #525;

"&Shortcuts|icons\shortcut.ico" 
   load "<xypath>\scripts\shortcuts.xys";

"&Recent Loc|:mru" button "mru";

"&Hotlist|:hotlist" button "hotlist";

"H&istory|icons\history.ico" #618;
The button is shown as the attached figure.

From the displayed button menu, we cannot the which key is hotkey. Can we add some indications, e.g. underscore or highlighted color, for those hokeys?

Re: Add indications for hotkeys

Posted: 06 Apr 2012 22:36
by Stefan
Normal this works by pressing the ALT-key, then the chars with the ampersand gets underlined. (Like with XY main menu)
But the CTB-menus are closed while pressing the ALT-key. That was maybe overlooked by Don?

As an tip to see that the ampersand basically works you can press and hold the ALT-key first, and click then the button.
You will see an warning dialog and after OKing them you see the mnemonics :roll:


Maybe use an work around like this:
"(&B)readcrumb|icons\breadcrumb.ico" #525;
"(&S)hortcuts|icons\shortcut.ico"
"(&R)ecent Loc|:mru" button "mru";
"(&H)otlist|:hotlist" button "hotlist";


Ahh, btw, you know that you can jump to the first char of each menu item by just pressing that leading char, even without any ampersand used?
All you have to do after this is pressing the enter key too.
This works even if more items have the same beginning char.

Re: Add indications for hotkeys

Posted: 07 Apr 2012 00:24
by eil
Stefan wrote:"(&H)otlist|:hotlist" button "hotlist";
what about these (& )? are they suppose to change something? :eh:

Re: Add indications for hotkeys

Posted: 07 Apr 2012 02:27
by avsfan
eil wrote:
Stefan wrote:"(&H)otlist|:hotlist" button "hotlist";
what about these (& )? are they suppose to change something? :eh:
I believe the difference is that not only are the hotkeys supposed to be underlined (using the "&" prefix), but the parentheses allow you to identify the hotkeys even if the underline doesn't work. (Right?)

Re: Add indications for hotkeys

Posted: 07 Apr 2012 09:17
by Stefan
Right!


Sorry, i should have make this more clear, but it was just obvious to myself :roll: .

Re: Add indications for hotkeys

Posted: 07 Apr 2012 11:16
by eil
avsfan wrote:I believe the difference is that not only are the hotkeys supposed to be underlined (using the "&" prefix), but the parentheses allow you to identify the hotkeys even if the underline doesn't work. (Right?)
i was guessing about something like that, but when i tried to make same thing to one of entries in my CTB drop-down menu, nothing changed -only first letter was in brackets. i must be missing something..

Re: Add indications for hotkeys

Posted: 07 Apr 2012 11:28
by highend
i must be missing something..
You aren't...
but the parentheses allow you to identify the hotkeys even if the underline doesn't work.

Re: Add indications for hotkeys

Posted: 07 Apr 2012 15:19
by eil
oh, now i get it, thanks to all. :oops:
if i'd only could make a shortcut to open CTB drop-down menu of a specific button. :roll:

Re: Add indications for hotkeys

Posted: 07 Apr 2012 16:14
by highend
if i'd only could make a shortcut to open CTB drop-down menu of a specific button.
Where's the problem?

Rightclick on your button: Toolbar...

Write down the ctb<number> of your button.
Let's assume it's "ctb10".

Menu - User - Manage Commands...

"Run Script"


Script: ::button "ctb<number of your button>";
or: ::button "ctb10";

Assign your hotkey....

Re: Add indications for hotkeys

Posted: 07 Apr 2012 16:18
by Stefan
eil wrote:if i'd only could make a shortcut to open CTB drop-down menu of a specific button. :roll:
Can't you?

You know there is

Code: Select all

Scripting Commands Reference

button
Emulates a click on a toolbar button.

Syntax 
button key, [action=1]

key [required] Key that identifies the button.
You can retrieve the existing keys using the SC toolbar, 
or using the Customize Toolbar command from a user button's context menu. 

action [optional] 
0 = do nothing
1 = left-click [default]
2 = right-click
8 = dropdown arrow

Re: Add indications for hotkeys

Posted: 07 Apr 2012 16:30
by paul0
Stefan wrote:
Maybe use an work around like this:
"(&B)readcrumb|icons\breadcrumb.ico" #525;
"(&S)hortcuts|icons\shortcut.ico"
"(&R)ecent Loc|:mru" button "mru";
"(&H)otlist|:hotlist" button "hotlist";
Thanks, Stefan. You are exactly right. I tried this way last week but was very quite comfortable with the button menu. Here, I reproduced the menu as the attached figure and compared with two menus. The menu without parentheses is cleaner and more readable.

Re: Add indications for hotkeys

Posted: 07 Apr 2012 16:58
by Stefan
Don't get me wrong.

I also would like to see this "&" ampersand underline mnemonics be working :lol:
(I only wanted to feedback that you didn't did anything wrong, it just didn't works just now)

Re: Add indications for hotkeys

Posted: 27 Apr 2012 17:26
by admin
Stefan wrote:Don't get me wrong.

I also would like to see this "&" ampersand underline mnemonics be working :lol:
(I only wanted to feedback that you didn't did anything wrong, it just didn't works just now)
I don't think it's possible.