Keyboard Send Problems

Tristan Richardson tjr@realvnc.com
Thu Nov 28 13:50:01 2002


You shouldn't be adding 'FF' to the front of the keysym.  For ASCII
characters the keysym is just the same as the ASCII value.  The only reason
your code appears to work for some characters is due to a bug in older
versions of WinVNC!  Keysyms beginning with 'FF' are for special keys like
function keys, Page Up, etc.  See page 17 of the protocol document
http://www.realvnc.com/docs/rfbproto.pdf for details.

Cheers

Tristan

----- Original Message -----
From: "Daaron Dwyer" <DDwyer@centrisinfo.com>
To: <vnc-list@realvnc.com>
Sent: Wednesday, November 27, 2002 10:26 PM
Subject: Keyboard Send Problems


> Hello All,
>
> This is my first attempt at a VNC port for Delphi (windows), so I am
> inexperienced.
> When I am trying to send a,b,c,j,P,Q,R,S,T,U, or V it doesn't seem to
work.
> When I send any other letters, it works quite well.
>
> I have since modelled more closely after the C++ code, but here is the
basic
> Delphi code I started with, and had the same effect:
>
> procedure Tviewer_frm.KeyEvent(Key: Word; Shift: TShiftState; IsDown :
> Boolean);
> const
>    keymessage : byte=4;
>    keydown    : byte=1;
>    keyup      : byte=0;
> var
>    keyint : Integer;
> begin
>      RFBClient.WriteBuffer(keymessage,1,TRUE);
>      if IsDown then RFBClient.WriteBuffer(keydown,1,TRUE)
>      else RFBClient.WriteBuffer(keyup,1,TRUE);
>      RFBClient.WriteBuffer(keydown,1,TRUE);  //padding
>      RFBClient.WriteBuffer(keydown,1,TRUE);  //padding
>
>      // accounting for ASCII shifting
>      if (key>64) and (key<90) and not (ssShift in Shift) then key :=
key+32;
>
>      keyint := StrToInt('$FF'+intToHex(key,2));
>      RFBClient.WriteInteger(keyint);
> end;
>
>
> The crude result of this when "a" is pressed is that Key is 97 and keyint
> becomes hex FF61.
> The odd thing to me is that FF61 ("a") doesn't work where FF64 ("d")
works.
>
> Am I missing something obvious?
> _______________________________________________
> VNC-List mailing list
> VNC-List@realvnc.com
> http://www.realvnc.com/mailman/listinfo/vnc-list