Jump to content

Keyboard shortcuts erratic for selecting main menu


delstone123
 Share

Recommended Posts

Hi

When my app runs, there is a main menu and some big buttons for wizards.

I've used the & key to highlight (underscore) certain letters and expected them to work when I use the alt combination with them. The buttons seem to generally work fine (though on occassion they do not - they simply do not respond to the alt combination) however the menu system does not work. No menu is pulled down. Any thoughts one what I could be doing wrong?

Some code snippets below:

Func CreateMainMenu()
    Local $file_menu, $tools_menu, $help_menu

;Create Menus and Items
$file_menu = GUICtrlCreateMenu("&File")
GUICtrlCreateMenuItem("E&xit", $file_menu)
GUICtrlSetOnEvent(-1, "CloseClicked")

$help_menu = GUICtrlCreateMenu("&Help")
GUICtrlCreateMenuItem("Install Latest &Updates", $help_menu)
GUICtrlSetOnEvent(-1, "InstallUpdates")
GUICtrlCreateMenuItem("&Help", $help_menu)
GUICtrlCreateMenuItem("", $help_menu)
GUICtrlCreateMenuItem("About &Us", $help_menu)
GUICtrlSetOnEvent(-1, "FBAboutUs")

EndFunc   ;==>CreateMainMenu
Link to comment
Share on other sites

it works fine with me Alt+F call the File menu

if it doesnt work with you please provide the exact code for more help

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

PhoenixXL, I think he wants to choose an option from a menu (via keyboard). :guitar: This example demonstrates working with menus using keyboard. It will open MS-Paint and then open File>Open:

ShellExecute("mspaint.exe")
WinWaitActive("untitled - Paint")
msgbox(64, "", "Now you will see open dialog")
Send("{ALT}FO")

:ermm: Was this what you wanted?

Edited by MKISH

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

MKISH,

why not try with WinMenuSelectItem

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Although you do have a point, but still I believe the OP wanted to do it by Keyboard, so I let it be like that way. I prefer and I follow the other path.

PhoenixXL, I think he wants to choose an option from a menu (via keyboard).

----------------------------------------

:bye: Hey there, was I helpful?

----------------------------------------

My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1

Link to comment
Share on other sites

  • 2 months later...

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...