I am using various combinations of Alt, Ctrl, and Shift with mouse clicks and mouse wheel actions as the input for my program. This program runs on the desktop and has a typical menu bar which is initialized as follows:
I track the state of the Alt, Ctrl & Shift keys via a case statement in the main loop based on the key up and key down events.
How do I disable the Alt key from interacting with the menu so when someone does an Alt-Left-Mouse-Button it doesn't activate the first menu entry?
function InitMenu() ; ----------------------------------------------------------------------------- ; Create a menu... ; ----------------------------------------------------------------------------- ; Note that the & sign in these examples underlines the next letter, and a ; blank menu name creates a 'bar'... .InitMenu mainmenu = CreateMenu ("&Game", MENU_GAME, WindowMenu (window)) mMenuGameConfig = CreateMenu( "&Config", MENU_GAME_CONFIG, mainmenu) mMenuGameSave = CreateMenu( "&Save", MENU_GAME_SAVE, mainmenu) mMenuGameLoad = CreateMenu( "&Load", MENU_GAME_LOAD, mainmenu) mMenuGameOffline = CreateMenu( "&Offline",MENU_GAME_OFFLINE, mainmenu) mMenuGameHost = CreateMenu( "&Host", MENU_GAME_HOST, mainmenu) mMenuGameJoin = CreateMenu( "&Join", MENU_GAME_JOIN, mainmenu) mMenuGameExit = CreateMenu( "E&xit", MENU_GAME_EXIT, mainmenu) mMenuGameHelp = CreateMenu( "&Help", MENU_HELP, WindowMenu(window)) mMenuGameControls = CreateMenu( "&Controls", MENU_HELP_CONTROLS, mMenuGameHelp) CreateMenu( "", MENU_HELP_BLANK, mMenuGameHelp) mMenuGameAbout = CreateMenu( "&About", MENU_HELP_ABOUT, mMenuGameHelp) enablemenu mMenuGameHost enablemenu mMenuGameJoin enablemenu mMenuGameConfig disablemenu mMenuGameOffline uncheckmenu mMenuGameHost uncheckmenu mMenuGameJoin enablemenu mMenuGameExit UpdateWindowMenu window ; This MUST be called after creating your menu! end function ;############################################################################### function EventKeyDown() Select EventData() Case SC_CTRL KBCtrlState = True Case SC_SHIFT KBShiftState = True Case SC_ALT KBAltState = True End Select end function ;############################################################################### function EventKeyUp() Select EventData() Case SC_CTRL KBCtrlState = False Case SC_SHIFT KBShiftState = False Case SC_ALT KBAltState = False End Select end function
I track the state of the Alt, Ctrl & Shift keys via a case statement in the main loop based on the key up and key down events.
How do I disable the Alt key from interacting with the menu so when someone does an Alt-Left-Mouse-Button it doesn't activate the first menu entry?