mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 11:58:12 +02:00
Cocoa: improve Enter key on the numeric keypad handled in KeyDown(), avoid beep
This commit is contained in:
parent
04b3d4b5d2
commit
705a74b957
@ -386,10 +386,12 @@ begin
|
||||
// If the form has a default or cancel button, capture Return and Escape to
|
||||
// prevent further processing. Actually clicking the buttons is handled in
|
||||
// the LCL in response to the keyUp
|
||||
if Assigned(wincallback) and (event.modifierFlags_ = 0) then
|
||||
// add NumericPadEnter supported.
|
||||
if Assigned(wincallback) and ((event.modifierFlags_=0) or (event.modifierFlags_=$200000)) then
|
||||
begin
|
||||
ch := NSEventRawKeyChar(event);
|
||||
if (((ch = System.WideChar(NSCarriageReturnCharacter)) and wincallback.HasDefaultControl)
|
||||
if (((ch = System.WideChar(NSCarriageReturnCharacter)) and wincallback.HasDefaultControl)
|
||||
or ((ch = System.WideChar(NSEnterCharacter)) and wincallback.HasDefaultControl)
|
||||
or ((ch = #27{Escape}) and wincallback.HasCancelControl)) then
|
||||
begin
|
||||
Result := true;
|
||||
|
Loading…
Reference in New Issue
Block a user