Fix keyboard input in various cases on macOS
This commit is contained in:
@@ -255,6 +255,15 @@ NSDragOperation GetDragDropOperation(DragDropEffect dragDropEffect)
|
||||
|
||||
@implementation MacWindowImpl
|
||||
|
||||
- (BOOL)canBecomeKeyWindow
|
||||
{
|
||||
if (Window && !Window->GetSettings().AllowInput)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeKey:(NSNotification*)notification
|
||||
{
|
||||
// Handle resizing to be sure that content has valid size when window was resized
|
||||
@@ -377,6 +386,10 @@ static void ConvertNSRect(NSScreen *screen, NSRect *r)
|
||||
// Ignore text from special keys
|
||||
case KeyboardKeys::Delete:
|
||||
case KeyboardKeys::Backspace:
|
||||
case KeyboardKeys::ArrowLeft:
|
||||
case KeyboardKeys::ArrowRight:
|
||||
case KeyboardKeys::ArrowUp:
|
||||
case KeyboardKeys::ArrowDown:
|
||||
return;
|
||||
}
|
||||
NSString* text = [event characters];
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace FlaxEngine.GUI
|
||||
desc.SupportsTransparency = false;
|
||||
desc.ShowInTaskbar = false;
|
||||
desc.ActivateWhenFirstShown = false;
|
||||
desc.AllowInput = true;
|
||||
desc.AllowInput = false;
|
||||
desc.AllowMinimize = false;
|
||||
desc.AllowMaximize = false;
|
||||
desc.AllowDragAndDrop = false;
|
||||
|
||||
Reference in New Issue
Block a user