Keypad Enter = Return !!

Kurt Seel kseel "at" utcorp.com
Tue, 18 Jan 2000 17:04:41 +0000


--------------9E95D973B7C9DF5AFABD8249
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by x-montana.utcorp.com id MAA22756


 Do you have a binary available (prefer 3.3.3). I don't
have a windows compiler.

HANS-JOERG_ELIAS "at" HP-Germany-om30.om.hp.com wrote:

> Hello,
>
> after taking a look at the windows sources I understood that windows do=
es
> not distinguish between Return and the keypad Enter key. There is no
> definition of VK_ENTER anywhere, the windows keycode generated is the
> VK_RETURN with the extension bit set.
> So anytime you press Enter it will be mapped to Return in vncviewer,
> server and java sources.
> On X however you have the KP_Enter and you can separate a Return from a
> keypad Return and we have some applications that specifically need the
> Enter and not the Return key.
>
> I started changing the vncviewer code by assigning the XK_KP_Enter each
> time VK_RETURN with the extension bit set comes in.
>
> KeyActionSpec KeyMap::PCtoX(UINT virtkey, DWORD keyData) {
>     UINT numkeys =3D 0;
>     UINT notEnter =3D 1;   // ***NEW
>
>     KeyActionSpec kas;
>     kas.releaseModifiers =3D 0;
>
>     bool extended =3D ((keyData & 0x1000000) !=3D 0);
>     log.Print(8,_T(" keyData %04x "), keyData);
>
>     if (extended) {
>         log.Print(8, _T(" (extended) "));
>         switch (virtkey) {
>         case VK_MENU :
>             virtkey =3D VK_RMENU; break;
>         case VK_CONTROL:
>             virtkey =3D VK_RCONTROL; break;
>    case VK_RETURN:     // ***NEW
>   kas.keycodes[numkeys++] =3D XK_KP_Enter; notEnter=3D0; break;
>         }
>     }
>
>     if(notEnter) {     // ***NEW
>   // We try looking it up in our table
>   UINT mapsize =3D sizeof(keymap) / sizeof(vncKeymapping);
>
>   // Look up the desired code in the table
>   for (UINT i =3D 0; i < mapsize; i++)
>   {
>    if (keymap[i].wincode =3D=3D virtkey) {
>     kas.keycodes[numkeys++] =3D keymap[i].Xcode;
>     break;
>    }
>   }
>  }
> (....)
>
> The Xvnc (no change needed) now works fine with the modified vncviewer,
> but the java-source and all other server/viewer needs to be changed.
> Do you agree that this needs to be changed, or is it just a feature tha=
t
> Enter maps to Return?
>
> Cheers,
> Hans-J=F6rg
>
> +----------------------------------------------------------------------=
+
> + Hans-Joerg Elias                              Hewlett Packard GmbH   =
+
> + Software Support Center Germany               Berliner Strasse 111   =
+
> + Network Team                                  40880 Ratingen         =
+
> + telnet: 705-6699  fax: +49 2102 907917        Germany                =
+
> + http://www.hewlett-packard.de/CSS-G           eMail hansj "at" grc.hp.com =
+
> + Geschaeftsfuehrer: Joerg Menno Harms (Vors.), Rudi Speier,           =
+
> + Heribert Schmitz, Fritz Schuller, Hans-Guenther Hohmann              =
+
> + Vorsitzender des Aufsichtsrates: Franz Nawratil                      =
+
> + Sitz der Gesellschaft: Boeblingen, Amtsgericht Boeblingen HRB 4081   =
+
> +----------------------------------------------------------------------=
+
>
> ---------------------------------------------------------------------
> The VNC mailing list - see http://www.uk.research.att.com/vnc/intouch.h=
tml
> ---------------------------------------------------------------------

--
"The opposite of a profound truth may well be another profound truth."
 - Bohr



--------------9E95D973B7C9DF5AFABD8249
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<br>&nbsp;Do you have a binary available&nbsp;(prefer 3.3.3). I don't
<br>have a windows compiler.
<p>HANS-JOERG_ELIAS "at" HP-Germany-om30.om.hp.com wrote:
<blockquote TYPE=CITE>Hello,
<p>after taking a look at the windows sources I understood that windows
does
<br>not distinguish between Return and the keypad Enter key. There is no
<br>definition of VK_ENTER anywhere, the windows keycode generated is the
<br>VK_RETURN with the extension bit set.
<br>So anytime you press Enter it will be mapped to Return in vncviewer,
<br>server and java sources.
<br>On X however you have the KP_Enter and you can separate a Return from
a
<br>keypad Return and we have some applications that specifically need
the
<br>Enter and not the Return key.
<p>I started changing the vncviewer code by assigning the XK_KP_Enter each
<br>time VK_RETURN with the extension bit set comes in.
<p>KeyActionSpec KeyMap::PCtoX(UINT virtkey, DWORD keyData) {
<br>&nbsp;&nbsp;&nbsp; UINT numkeys = 0;
<br>&nbsp;&nbsp;&nbsp; UINT notEnter = 1;&nbsp;&nbsp; // ***NEW
<p>&nbsp;&nbsp;&nbsp; KeyActionSpec kas;
<br>&nbsp;&nbsp;&nbsp; kas.releaseModifiers = 0;
<p>&nbsp;&nbsp;&nbsp; bool extended = ((keyData &amp; 0x1000000) != 0);
<br>&nbsp;&nbsp;&nbsp; log.Print(8,_T(" keyData %04x "), keyData);
<p>&nbsp;&nbsp;&nbsp; if (extended) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log.Print(8, _T(" (extended)
"));
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (virtkey) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case VK_MENU :
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
virtkey = VK_RMENU; break;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case VK_CONTROL:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
virtkey = VK_RCONTROL; break;
<br>&nbsp;&nbsp; case VK_RETURN:&nbsp;&nbsp;&nbsp;&nbsp; // ***NEW
<br>&nbsp; kas.keycodes[numkeys++] = XK_KP_Enter; notEnter=0; break;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>&nbsp;&nbsp;&nbsp; }
<p>&nbsp;&nbsp;&nbsp; if(notEnter) {&nbsp;&nbsp;&nbsp;&nbsp; // ***NEW
<br>&nbsp; // We try looking it up in our table
<br>&nbsp; UINT mapsize = sizeof(keymap) / sizeof(vncKeymapping);
<p>&nbsp; // Look up the desired code in the table
<br>&nbsp; for (UINT i = 0; i &lt; mapsize; i++)
<br>&nbsp; {
<br>&nbsp;&nbsp; if (keymap[i].wincode == virtkey) {
<br>&nbsp;&nbsp;&nbsp; kas.keycodes[numkeys++] = keymap[i].Xcode;
<br>&nbsp;&nbsp;&nbsp; break;
<br>&nbsp;&nbsp; }
<br>&nbsp; }
<br>&nbsp;}
<br>(....)
<p>The Xvnc (no change needed) now works fine with the modified vncviewer,
<br>but the java-source and all other server/viewer needs to be changed.
<br>Do you agree that this needs to be changed, or is it just a feature
that
<br>Enter maps to Return?
<p>Cheers,
<br>Hans-J&ouml;rg
<p>+----------------------------------------------------------------------+
<br>+ Hans-Joerg Elias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Hewlett Packard GmbH&nbsp;&nbsp; +
<br>+ Software Support Center Germany&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Berliner Strasse 111&nbsp;&nbsp; +
<br>+ Network Team&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
40880 Ratingen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +
<br>+ telnet: 705-6699&nbsp; fax: +49 2102 907917&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Germany&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
<br>+ <a href="http://www.hewlett-packard.de/CSS-G">http://www.hewlett-packard.de/CSS-G</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
eMail hansj "at" grc.hp.com +
<br>+ Geschaeftsfuehrer: Joerg Menno Harms (Vors.), Rudi Speier,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
<br>+ Heribert Schmitz, Fritz Schuller, Hans-Guenther Hohmann&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
<br>+ Vorsitzender des Aufsichtsrates: Franz Nawratil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
<br>+ Sitz der Gesellschaft: Boeblingen, Amtsgericht Boeblingen HRB 4081&nbsp;&nbsp;
+
<br>+----------------------------------------------------------------------+
<p>---------------------------------------------------------------------
<br>The VNC mailing list - see <a href="http://www.uk.research.att.com/vnc/intouch.html">http://www.uk.research.att.com/vnc/intouch.html</a>
<br>---------------------------------------------------------------------</blockquote>

<pre>--
"The opposite of a profound truth may well be another profound truth."
&nbsp;- Bohr</pre>
&nbsp;</html>

--------------9E95D973B7C9DF5AFABD8249--


---------------------------------------------------------------------
The VNC mailing list - see http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------