mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 04:39:24 +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
|
var
|
||||||
textView: NSView;
|
textView: NSView;
|
||||||
isFirst: Boolean;
|
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
|
begin
|
||||||
if (not _inIME) and (theEvent.keyCode in
|
if isControlKey or isSpaceShortCut then
|
||||||
[kVK_Return, kVK_ANSI_KeypadEnter, kVK_Escape]) then
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user