title: How to use window focus messages for a Delphi on-screen keyboard form
body: <p>I need a built-in on screen numeric keypad in my Application. For various reasons I cannot use the <a href="http://www.tmssoftware.com/site/atkbd.asp" rel="nofollow noreferrer">TMS Software</a> or other commercial component offerings. I'm very happy with a button-based solution shown below but I cannot yet see how to solve the focus switch issue where clicking the button activates the keypad form and I lose the focused control into which I wanted the characters. My solution works if I keep the keypad buttons within the target form but I would like a form-independent solution. Is there a way of disabling the button activation or knowing where the focus came from so that I can use something like Scree.ActiveControl :=?? to put it back?</p>
  
  <p><img src="https://i.stack.imgur.com/FSR5x.jpg" alt="enter image description here"></p>