diff --git a/lcl/forms.pp b/lcl/forms.pp index 5dee27b7bf..60729c0cb1 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -1033,7 +1033,7 @@ type function HelpKeyword(Sender: TObject; const Position: TPoint; const Keyword: String): Boolean; function HelpKeyword(const Keyword: String): Boolean; - procedure ShowHelpForObjecct(Sender: TObject); + procedure ShowHelpForObject(Sender: TObject); procedure HideAllFormsWithStayOnTop; function IsWaiting: boolean; procedure CancelHint; diff --git a/lcl/include/application.inc b/lcl/include/application.inc index 643b56a1d9..d9b29cc8fa 100644 --- a/lcl/include/application.inc +++ b/lcl/include/application.inc @@ -978,7 +978,7 @@ begin Result:=HelpKeyword(nil,Point(0,0),Keyword); end; -procedure TApplication.ShowHelpForObjecct(Sender: TObject); +procedure TApplication.ShowHelpForObject(Sender: TObject); begin if Sender is TControl then begin TControl(Sender).ShowHelp; @@ -1293,8 +1293,8 @@ begin i:=FApplicationHandlers[ahtKeyDownAfter].Count; while FApplicationHandlers[ahtKeyDownAfter].NextDownIndex(i) do TKeyEvent(FApplicationHandlers[ahtKeyDownAfter][i])(Sender,Key,Shift); - if (Shift=[]) and (Key=VK_F1) then - ShowHelpForObjecct(Sender); + if WidgetSet.IsHelpKey(Key, Shift) then + ShowHelpForObject(Sender); end; procedure TApplication.ControlKeyDown(Sender: TObject; var Key: Word; diff --git a/lcl/include/intfbasewinapi.inc b/lcl/include/intfbasewinapi.inc index 117bc70b9a..bfd22bc6a2 100644 --- a/lcl/include/intfbasewinapi.inc +++ b/lcl/include/intfbasewinapi.inc @@ -1030,6 +1030,12 @@ begin Result := false; end; +function TWidgetSet.IsHelpKey(Key: Word; Shift: TShiftState): Boolean; +{ Asks if the passed key is determined by widgetset to show help } +begin + Result := (Shift = []) and (Key = VK_F1); +end; + function TWidgetSet.AppHandle: Thandle; begin DebugLn('Warning: AppHandle is not implemented for this widgetset yet'); diff --git a/lcl/interfacebase.pp b/lcl/interfacebase.pp index 10eb22dfba..c4339e17ff 100644 --- a/lcl/interfacebase.pp +++ b/lcl/interfacebase.pp @@ -93,6 +93,7 @@ type procedure SetDesigning(AComponent: TComponent); virtual; abstract; function InitHintFont(HintFont: TObject): Boolean; virtual; + function IsHelpKey(Key: Word; Shift: TShiftState): Boolean; virtual; // create and destroy function CreateComponent(Sender : TObject): THandle; virtual; abstract;