delphi - Why won't my control accept keyboard input? -
i've built custom control i'm trying send input to. accept mouse input , report mousedown, mousemove , mouseup correctly, whatever reason, won't accept keyboard input. when click on it, doesn't receive focus, , keys press interpreted whatever control had focus already.
this simple. first place thought in controlstyle property, thing can see in helpfile keyboard input csnostdevents, disables it, , control doesn't have that. need make control can receive input focus?
a few things try:
- on
mousedown, callwindows.setfocus(handle). in experience, winapi functionsetfocusworks better vcl'ssetfocusmethod. - in response
wm_getdlgcodemessage, replymessage.result := message.result or dlgc_wantchars or dlgc_wantarrows or dlgc_wanttab or dlgc_wantallkeys;
Comments
Post a Comment