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>
<br> Do you have a binary available (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> UINT numkeys = 0;
<br> UINT notEnter = 1; // ***NEW
<p> KeyActionSpec kas;
<br> kas.releaseModifiers = 0;
<p> bool extended = ((keyData & 0x1000000) != 0);
<br> log.Print(8,_T(" keyData %04x "), keyData);
<p> if (extended) {
<br> log.Print(8, _T(" (extended)
"));
<br> switch (virtkey) {
<br> case VK_MENU :
<br>
virtkey = VK_RMENU; break;
<br> case VK_CONTROL:
<br>
virtkey = VK_RCONTROL; break;
<br> case VK_RETURN: // ***NEW
<br> kas.keycodes[numkeys++] = XK_KP_Enter; notEnter=0; break;
<br> }
<br> }
<p> if(notEnter) { // ***NEW
<br> // We try looking it up in our table
<br> UINT mapsize = sizeof(keymap) / sizeof(vncKeymapping);
<p> // Look up the desired code in the table
<br> for (UINT i = 0; i < mapsize; i++)
<br> {
<br> if (keymap[i].wincode == virtkey) {
<br> kas.keycodes[numkeys++] = keymap[i].Xcode;
<br> break;
<br> }
<br> }
<br> }
<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örg
<p>+----------------------------------------------------------------------+
<br>+ Hans-Joerg Elias
Hewlett Packard GmbH +
<br>+ Software Support Center Germany
Berliner Strasse 111 +
<br>+ Network Team
40880 Ratingen +
<br>+ telnet: 705-6699 fax: +49 2102 907917
Germany
+
<br>+ <a href="http://www.hewlett-packard.de/CSS-G">http://www.hewlett-packard.de/CSS-G</a>
eMail hansj "at" grc.hp.com +
<br>+ Geschaeftsfuehrer: Joerg Menno Harms (Vors.), Rudi Speier,
+
<br>+ Heribert Schmitz, Fritz Schuller, Hans-Guenther Hohmann
+
<br>+ Vorsitzender des Aufsichtsrates: Franz Nawratil
+
<br>+ Sitz der Gesellschaft: Boeblingen, Amtsgericht Boeblingen HRB 4081
+
<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."
- Bohr</pre>
</html>
--------------9E95D973B7C9DF5AFABD8249--
---------------------------------------------------------------------
The VNC mailing list - see http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------