PlatformMenuBarData
Engine/source/platformMac/menus/menuBarMac.cpp
Public Attributes
EventHandlerRef
EventTime
EventHandlerRef
More evil hacking for OSX.
Public Functions
Detailed Description
Public Attributes
EventHandlerRef mCommandEventHandlerRef
EventTime mLastCloseTime
EventHandlerRef mMenuEventHandlerRef
U32 mMenuOpenCount
More evil hacking for OSX.
There seems to be no way to disable menu shortcuts and they are automatically routed within that Cocoa thing outside of our control. Also, there's no way of telling what triggered a command event and thus no way of knowing whether it was a keyboard shortcut. Sigh.
So what we do here is monitor the sequence of events leading to a command event. We capture the time the last open menu was closed and then, when we receive a command event (which are dished out after the menus are closed) and keyboard accelerators are disabled, we check whether we are a certain very short time away in the event stream from the menu close event. If so, we figure the event came from clicking in a menu.
Utterly evil and dirty but seems to do the trick.
