Tuesday, May 31, 2016

Firemonkey & Form.KeyPreview

Wer hat nicht in Firemokey schon das Form.KeyPreview vermisst?


Der einfachste Workaround hierfür ist:

type
  TForm1 = class( TForm )
  private
    { Private-Deklarationen }
  protected
   
procedure IsDialogKey(const Key: Word;

                          const KeyChar: WideChar;
                          const Shift: TShiftState;
                          var IsDialog: boolean); override;   
  public
    { Public-Deklarationen }
  end;


Aber nicht den inherited vergessen!

2 comments:

  1. Hello. I am trying to detect on android when the "return" key is pressed on the smartphone's virtual keyboard to change focus to the next field in TabOrder order. How should you deploy this?

    ReplyDelete