mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 20:18:47 +02:00
Backends: OSX: Forward keyDown/keyUp events to OS when unused by Dear ImGui.
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
|
||||
// CHANGELOG
|
||||
// (minor and older changes stripped away, please see git history for details)
|
||||
// 2022-02-07: Inputs: Forward keyDown/keyUp events to OS when unused by dear imgui.
|
||||
// 2022-01-31: Fix building with old Xcode versions that are missing gamepad features.
|
||||
// 2022-01-26: Inputs: replaced short-lived io.AddKeyModsEvent() (added two weeks ago)with io.AddKeyEvent() using ImGuiKey_ModXXX flags. Sorry for the confusion.
|
||||
// 2021-01-20: Inputs: calling new io.AddKeyAnalogEvent() for gamepad support, instead of writing directly to io.NavInputs[].
|
||||
@ -131,7 +132,8 @@ static double GetMachAbsoluteTimeInSeconds()
|
||||
|
||||
- (void)keyDown:(NSEvent*)event
|
||||
{
|
||||
ImGui_ImplOSX_HandleEvent(event, self);
|
||||
if (!ImGui_ImplOSX_HandleEvent(event, self))
|
||||
[super keyDown:event];
|
||||
|
||||
// Call to the macOS input manager system.
|
||||
[self interpretKeyEvents:@[event]];
|
||||
@ -139,7 +141,8 @@ static double GetMachAbsoluteTimeInSeconds()
|
||||
|
||||
- (void)keyUp:(NSEvent*)event
|
||||
{
|
||||
ImGui_ImplOSX_HandleEvent(event, self);
|
||||
if (!ImGui_ImplOSX_HandleEvent(event, self))
|
||||
[super keyUp:event];
|
||||
}
|
||||
|
||||
- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
|
||||
|
Reference in New Issue
Block a user