Why won't my control accept keyboard input?

后端 未结 5 1116
梦谈多话
梦谈多话 2021-01-18 23:09

I\'ve built a custom control that I\'m trying to send input to. It will accept mouse input and report MouseDown, MouseMove and MouseUp correctly, but for whatever reason, i

5条回答
  •  一整个雨季
    2021-01-18 23:41

    I've checked the code for my control and I can't see anything that might stop this working. Are you calling "inherited" in the Create procedure?

    I do handle the following, but nothing special:

    procedure WMSetFocus(var Message: TWMSetFocus); message WM_SETFOCUS;
    procedure WMKillFocus(var Message: TWMKillFocus); message WM_KILLFOCUS;
    procedure WMGetDlgCode(var Message: TWMGetDlgCode); message WM_GETDLGCODE;
    
    procedure KeyDown(var Key: Word; Shift: TShiftState); override;
    

提交回复
热议问题