cocoa: adding a direct call of .keyDown when handling sendEvent() of NSWindow (not NSPanel). Cocoa prevents call to .keyDown() with Control+Arrow Keys in IDE configuration

git-svn-id: trunk@58648 -
This commit is contained in:
dmitry 2018-07-29 06:31:20 +00:00
parent 17dd3e68b9
commit 123ec7ffae

View File

@ -851,6 +851,20 @@ begin
else
inherited sendEvent(event);
end
else if event.type_ = NSKeyDown then
begin
if Assigned(firstResponder) and (firstResponder.isKindOfClass_(TCocoaCustomControl)) then
begin
//todo: (hack!) for whatever Cocoa prevents the processing of Control+Left, Control+Right (Control+Arrow Keys)
// events in IDE configuration. The standalone test is working just fine.
// presumably NSWindow.sendEvent() should call keyDown() directly
// (the only keys supressesed by Cocoa are Tab or Shift+Tab)
// So, instead of figuring out why Cocoa suppresses the navigation
// the overrride method simply forces keyDown() call
firstResponder.keyDown(event);
end else
inherited sendEvent(event);
end
else
inherited sendEvent(event);
end;