Backends: OSX: Update to use io.AddEventKey() will full key map (#2625, #1873, #4858)

This commit is contained in:
thedmd
2021-12-12 12:04:13 +01:00
committed by ocornut
parent da1864d79e
commit ee436aa803
4 changed files with 207 additions and 104 deletions

View File

@ -36,15 +36,6 @@
-(void)initialize
{
// Some events do not raise callbacks of AppView in some circumstances (for example when CMD key is held down).
// This monitor taps into global event stream and captures these events.
NSEventMask eventMask = NSEventMaskKeyDown | NSEventMaskKeyUp | NSEventMaskFlagsChanged;
[NSEvent addLocalMonitorForEventsMatchingMask:eventMask handler:^NSEvent * _Nullable(NSEvent *event)
{
ImGui_ImplOSX_HandleEvent(event, self);
return event;
}];
// Setup Dear ImGui context
// FIXME: This example doesn't have proper cleanup...
IMGUI_CHECKVERSION();