Vahan,

>     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?

I wrote a touchscreen kiosk that did the same kind of thing. A keyboard
made of TSpeedButton components which were all bound to the same
OnClick event handler. I used a more direct approach. Instead of sending
messages to the control, I checked to make sure the ActiveControl was
a TEdit, then did TEdit(ActiveControl).SelText:=Caption (the caption on the
TSpeedButton). This works for the normal keys. For the command keys,
like the backspace, I checked to make sure that SelStart > 0, then did
SelStart:=SelStart-1, then SelLength:=1, then SelText:='';

HTH,

Glenn Lawler



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h9gtb9c/M=362335.6886445.7839731.1510227/D=groups/S=1705115362:TM/Y=YAHOO/EXP=1124211549/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