Some controls eat sortcuts
Original Reporter info from Mantis: alexx
-
Reporter name: Alexander Todorov
Original Reporter info from Mantis: alexx
- Reporter name: Alexander Todorov
Description:
When there are placed controls on a form OnShortCut event does not fire in some cases.
Under Windows all forks fine.
Under Gtk2 when the focused control is TEdit, TDateEdit (perhaps all descendants of TCustomEdit) OnShortCut is not fired.
Under Gtk1 when the focused control is TEdit, TDateEdit, TMemo OnShortCut is not fired.
Steps to reproduce:
I have put these control on an empty form:
TEdit, TDateEdit, TMemo, TButton, TCheckBox, TRadioButton and TTreeView.
You may want to test with other controls too.
//------------------------------------------------------------------
procedure TForm1.FormShortCut(var Msg: TLMKey; var Handled: Boolean);
var ShortCut: TShortCut;
ShiftState: TShiftState;
begin
ShiftState := KeyDataToShiftState(Msg.KeyData);
ShortCut := KeyToShortCut(Msg.CharCode, ShiftState);
writeln(ShortCutToText(ShortCut));
Handled := true;
end;
//-------------------------------------
Click on a control to make it focused then press a shortcut (Ctrl+S) and watch the output.
Mantis conversion info:
- Mantis ID: 2027
- OS: Linux
- Platform: i386
- Version: 0.9.14
- Target version: 1.0.0
- LazTarget: 1.0