cocoa: patch by lks, to handle keyup events with CMD key hold. #33503. Patch applied with a small change of always inheriting sendEvent method

git-svn-id: trunk@57617 -
This commit is contained in:
dmitry 2018-04-07 04:49:53 +00:00
parent 1a38dc5407
commit ffd19f25dc

View File

@ -82,6 +82,7 @@ type
isrun : Boolean;
function isRunning: Boolean; override;
procedure run; override;
procedure sendEvent(theEvent: NSEvent); override;
end;
{ TCocoaWidgetSet }
@ -368,6 +369,15 @@ begin
aloop();
end;
procedure TCocoaApplication.sendEvent(theEvent: NSEvent);
begin
// https://stackoverflow.com/questions/4001565/missing-keyup-events-on-meaningful-key-combinations-e-g-select-till-beginning
if (theEvent.type_ = NSKeyUp) and
((theEvent.modifierFlags and NSCommandKeyMask) = NSCommandKeyMask)
then
self.keyWindow.sendEvent(theEvent);
inherited sendEvent(theEvent);
end;
// the implementation of the utility methods
{$I cocoaobject.inc}