mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 02:28:04 +02:00
lcl: move shortcut handling from after interface to before interface (bug #0016990)
git-svn-id: trunk@26833 -
This commit is contained in:
parent
f09d8860b7
commit
013200586a
@ -5577,6 +5577,24 @@ begin
|
||||
KeyDownBeforeInterface(CharCode, ShiftState);
|
||||
if CharCode = VK_UNKNOWN then Exit;
|
||||
end;
|
||||
|
||||
// check the shortcuts
|
||||
// check popup menu
|
||||
if Assigned(FPopupMenu) and FPopupMenu.IsShortCut(Message) then
|
||||
Exit;
|
||||
|
||||
// let each parent form handle shortcuts
|
||||
AParent := Parent;
|
||||
while Assigned(AParent) do
|
||||
begin
|
||||
if (AParent is TCustomForm) and TCustomForm(AParent).IsShortcut(Message) then
|
||||
Exit;
|
||||
AParent := AParent.Parent;
|
||||
end;
|
||||
|
||||
// let application handle shortcut
|
||||
if Assigned(Application) and Application.IsShortcut(Message) then
|
||||
Exit;
|
||||
end;
|
||||
|
||||
Result := False;
|
||||
@ -5611,29 +5629,11 @@ end;
|
||||
function TWinControl.DoRemainingKeyDown(var Message: TLMKeyDown): Boolean;
|
||||
var
|
||||
ShiftState: TShiftState;
|
||||
AParent: TWinControl;
|
||||
begin
|
||||
Result := True;
|
||||
|
||||
ShiftState := KeyDataToShiftState(Message.KeyData);
|
||||
|
||||
// check popup menu
|
||||
if Assigned(FPopupMenu) and FPopupMenu.IsShortCut(Message) then
|
||||
Exit;
|
||||
|
||||
// let each parent form handle shortcuts
|
||||
AParent := Parent;
|
||||
while Assigned(AParent) do
|
||||
begin
|
||||
if (AParent is TCustomForm) and TCustomForm(AParent).IsShortcut(Message) then
|
||||
Exit;
|
||||
AParent := AParent.Parent;
|
||||
end;
|
||||
|
||||
// let application handle shortcut
|
||||
if Assigned(Application) and Application.IsShortcut(Message) then
|
||||
Exit;
|
||||
|
||||
// let parent(s) handle key from child key
|
||||
if Assigned(Parent) and Parent.ChildKey(Message) then
|
||||
Exit;
|
||||
|
@ -377,8 +377,6 @@ begin
|
||||
PostQuitMessage(AMessage.wParam);
|
||||
break;
|
||||
end;
|
||||
// todo: maybe check the keyboard messages here before their applying to window
|
||||
// to prevent system keys mix with LCL shortcuts?
|
||||
TranslateMessage(@AMessage);
|
||||
{$IFDEF WindowsUnicodeSupport}
|
||||
if UnicodeEnabledOS then
|
||||
|
Loading…
Reference in New Issue
Block a user