How to assign shortcuts to a firemonkey TForm OnKeyDown Event:

  

I’m having trouble assigning a shortcut to a TabItem on Firemonkey, using the form’s OnKeyDown event.

It seems that the ctrl key works like it’s being pressed and released over and over again.

Here is what I’m trying to do:

procedure TfrmPrincipal.FormKeyDown(Sender: TObject; var Key: Word;
var KeyChar: Char; Shift: TShiftState);
begin
if ssCtrl in Shift then
begin
if UpperCase(KeyChar) = ‘L’ then
TabItem1.SetFocus;
end;
end;

It doesn’t work and after googling a while and found a lot of VCL driven answers, I couldn’t find anything that can help me with Firemonkey.

I’m using Tokyo 10.2.2

Any tips?

Thanks in advance.

Comments are closed.