diff --git a/lcl/interfaces/cocoa/cocoaconst.pas b/lcl/interfaces/cocoa/cocoaconst.pas index 1a86ff84ec..6052f6b717 100644 --- a/lcl/interfaces/cocoa/cocoaconst.pas +++ b/lcl/interfaces/cocoa/cocoaconst.pas @@ -38,6 +38,7 @@ var NSSTR_LINE_SEPARATOR: NSString; NSSTR_PARAGRAPH_SEPARATOR: NSString; + NSSTR_KEY_ENTER: NSString; NSSTR_KEY_ESC: NSString; NSSTR_KEY_EQUALS: NSString; NSSTR_KEY_PLUS: NSString; @@ -62,6 +63,7 @@ initialization NSSTR_LINE_SEPARATOR:= NSString.alloc.initWithUTF8String(#$E2#$80#$A8); NSSTR_PARAGRAPH_SEPARATOR:= NSString.alloc.initWithUTF8String(#$E2#$80#$A9); + NSSTR_KEY_ENTER:= NSSTR(#13); NSSTR_KEY_ESC:= NSSTR(#27); NSSTR_KEY_EQUALS:= NSSTR('='); NSSTR_KEY_PLUS:= NSSTR('+'); diff --git a/lcl/interfaces/cocoa/cocoalclintf.inc b/lcl/interfaces/cocoa/cocoalclintf.inc index ca4353bcda..d01a0894a0 100644 --- a/lcl/interfaces/cocoa/cocoalclintf.inc +++ b/lcl/interfaces/cocoa/cocoalclintf.inc @@ -290,7 +290,7 @@ begin aButton.setKeyEquivalentModifierMask(0); if I = DefaultIndex then - aButton.setKeyEquivalent(NSSTR_KEY_ESC) + aButton.setKeyEquivalent(NSSTR_KEY_ENTER) else if I = 0 then // By default, the first button is the default button. If in our // case this should not be the case, remove the default status