Hi Vahan,

The flaw in your code is that you're sending keystrokes to the edit
control, but the Backspace key isn't a real keystroke. It is a special
action that gets processed by the keyboard driver. In your case, you
would have to do the same and to do that, you should use the WINAPI
function keybd_event instead. On NT/2000/XP, this API has an even more
powerful version which is called SendInput.

The thing is, your virtual keyboard must communicate with the keyboard
driver, not with any controls that you have on your form.

Your "solution" is sending a VK_BACK to the control, which basically
tells it to add Char(VK_BACK) to the text in it. And that is the weird
character you're seeing... And why? Simple. You just sent it a
WM_CHAR, telling it to add this char...

With kind regards,
X Katja Bergman.


--- In [email protected], "Vahan Yoghoudjian" <[EMAIL PROTECTED]> wrote:
>     I have designed a virtual keyboard for my application where the
user can
> launch a form anywhere within the application and write into the focused
> control.
> 
>     I have created my own keyboard buttons and used them on the keyboard
> form. Those components have a property called value. Every time a key is
> pressed I do the following
> 
>         SendMessage(TheActiveControl.Handle,WM_CHAR,KeyValue,0)
> 
> I have the button backspace which key value is initialized like:
> KeyBackspace.KeyValue := VK_BACK
> 
>     When I click on the backspace key, instead of erasing the last
character
> written I have weird characters written on my controls... any ideas
what am
> I doing wrong here?
> 
> Thanks in advance
> Vahan
> 
> 
> [Non-text portions of this message have been removed]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hfdfvtr/M=362335.6886445.7839731.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1124275544/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In
 low income neighborhoods, 84% do not own computers. At Network for Good, help 
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~-> 

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to