mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:19:16 +02:00
Cocoa: fix Space Key with Modifers in CustomControl
This commit is contained in:
parent
cd560cc67d
commit
978bc3a3ab
@ -326,9 +326,29 @@ procedure TCocoaCustomControlWithBaseInputClient.keyDown(theEvent: NSEvent);
|
||||
var
|
||||
textView: NSView;
|
||||
isFirst: Boolean;
|
||||
|
||||
function isControlKey: Boolean;
|
||||
begin
|
||||
Result:= False;
|
||||
if _inIME then
|
||||
Exit;
|
||||
Result:= theEvent.keyCode in [kVK_Return, kVK_ANSI_KeypadEnter, kVK_Escape];
|
||||
end;
|
||||
|
||||
function isSpaceShortCut: Boolean;
|
||||
const
|
||||
ModifiersOfInterest: NSUInteger = (NSControlKeyMask or NSShiftKeyMask or NSAlternateKeyMask or NSCommandKeyMask or NSFunctionKeyMask);
|
||||
begin
|
||||
Result:= False;
|
||||
if _inIME then
|
||||
Exit;
|
||||
if theEvent.keyCode <> kVK_Space then
|
||||
Exit;
|
||||
Result:= (theEvent.modifierFlags and ModifiersOfInterest) <> 0;
|
||||
end;
|
||||
|
||||
begin
|
||||
if (not _inIME) and (theEvent.keyCode in
|
||||
[kVK_Return, kVK_ANSI_KeypadEnter, kVK_Escape]) then
|
||||
if isControlKey or isSpaceShortCut then
|
||||
begin
|
||||
inherited;
|
||||
exit;
|
||||
|
Loading…
Reference in New Issue
Block a user