Jump to content

How do you create menu items that also use key combos?


LostUser
 Share

Recommended Posts

I am making windows and using some menu items where some have the under score so you can use that letter to execute that item. I would also like the option of being able to use a key combination like ctrl-s for save rather than going to File\Save and other things.

What I need to know basically is how do you get the key combo to display with menu item and allow it to actually be used.

I was thinking of just putting the key combo text in the menu along with the menu item text and doing a hotkeyset for whatever key combos I need to do. Is there another guictrl... way or do you just put it in the text and make the hotkeyset?

If that doesn't quite make sense I can try to explain further.

Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Link to comment
Share on other sites

I could have sworn there was a way to automatically tie the keys into the menu file by using the "pipe" command (|) at the end of your menu title. Example:

$mFile = GuiCtrlCreateMenu( '&File' )
$mFOpen = GuiCtrlCreateMenuItem( '&Open | CTRL+O', $mFile )
$mFClose = GuiCtrlCreateMenuItem( '&Close | ALT+F4', $mFile )
Spoiler

 

"...Yes, I am a criminal. My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like.My crime is that of outsmarting you, something that you will never forgive me for." --The Mentor

"Mess with the best, die like the rest!!" -Hackers

"This above all to thine own self be true." -William Shakespeare

"Corruption is only as corrupted as the individual makes it out to be." -i386

 

style7,AutoIt.png

 

 

Link to comment
Share on other sites

I could have sworn there was a way to automatically tie the keys into the menu file by using the "pipe" command (|) at the end of your menu title. Example:

$mFile = GuiCtrlCreateMenu( '&File' )
$mFOpen = GuiCtrlCreateMenuItem( '&Open | CTRL+O', $mFile )
$mFClose = GuiCtrlCreateMenuItem( '&Close | ALT+F4', $mFile )
I tried doing that and it doesn't seem to work. I tried separating the Pipe command in different ways, using Ctrl+S in quotes, out of quotes, with {} brackets. None works yet. The only thing I can get to do it so far is the HotKeySet command...which is fine I suppose.

Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...