mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 20:39:25 +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
|
// If the form has a default or cancel button, capture Return and Escape to
|
||||||
// prevent further processing. Actually clicking the buttons is handled in
|
// prevent further processing. Actually clicking the buttons is handled in
|
||||||
// the LCL in response to the keyUp
|
// 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
|
begin
|
||||||
ch := NSEventRawKeyChar(event);
|
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
|
or ((ch = #27{Escape}) and wincallback.HasCancelControl)) then
|
||||||
begin
|
begin
|
||||||
Result := true;
|
Result := true;
|
||||||
|
Loading…
Reference in New Issue
Block a user