Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/pmax/dev Map keypad 'Enter' to 'Return' for console...



details:   https://anonhg.NetBSD.org/src/rev/259a880561f9
branches:  trunk
changeset: 471846:259a880561f9
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Apr 13 03:19:28 1999 +0000

description:
Map keypad 'Enter' to 'Return' for console operation. Change error messages
in MouseInit() to allow gcc to fold the strings.

diffstat:

 sys/arch/pmax/dev/lk201.c |  22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diffs (75 lines):

diff -r b9b87f2fe0f8 -r 259a880561f9 sys/arch/pmax/dev/lk201.c
--- a/sys/arch/pmax/dev/lk201.c Tue Apr 13 03:14:03 1999 +0000
+++ b/sys/arch/pmax/dev/lk201.c Tue Apr 13 03:19:28 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lk201.c,v 1.12 1999/03/22 03:25:29 ad Exp $ */
+/* $NetBSD: lk201.c,v 1.13 1999/04/13 03:19:28 ad Exp $ */
 
 /*
  * The LK201 keycode mapping routine is here, along with initialization
@@ -319,14 +319,19 @@
                        "lk201: keyboard error, code=%x\n", cc);
                return (NULL);
        }
+       
        if (shiftDown)
                cc = shiftedAscii[cc];
        else
                cc = unshiftedAscii[cc];
-       if (cc >= KBD_NOKEY) {
+
+       /* Map keypad 'Enter' key to return */
+       if (cc == KBD_KP_ENTER)
+               cc = KBD_RET;
+       else if (cc >= KBD_NOKEY) {
                int i;
                
-               /* XXX slow, although keyboard interrupts aren't frequent... */
+               /* XXX slow, although keyboard interrupts aren't frequent */
                
                /* Check for keys that have multi-character codes */
                for (i = 0; i < NUM_TOSTRING; i++)
@@ -346,6 +351,7 @@
                         * return as F15 and F16 since that's what they
                         * really are.
                         * XXX termcap can only handle F0->F9. Is this right?
+                        * XXX 'Do' is used for dropping into ddb.
                         */
                        if (cc >= KBD_F1 && cc <= KBD_F6) {
                                buf[3] = '2';
@@ -365,7 +371,7 @@
                        cp = buf;
                }
        }
-       if (cc >= 'a' && cc <= 'z') {
+       else if (cc >= 'a' && cc <= 'z') {
                if (ctrlDown)
                        cc = cc - 'a' + '\1'; /* ^A */
                else if (shiftDown ^ capsLock)
@@ -472,22 +478,22 @@
                return;
        }
        if (id_byte1 < 0) {
-               printf("MouseInit: Timeout on 1st byte of self-test report\n");
+               printf("MouseInit: Timeout on %s byte of self-test report\n", "1st");
                return;
        }
        id_byte2 = (*getc)(mdev);
        if (id_byte2 < 0) {
-               printf("MouseInit: Timeout on 2nd byte of self-test report\n");
+               printf("MouseInit: Timeout on %s byte of self-test report\n", "2nd");
                return;
        }
        id_byte3 = (*getc)(mdev);
        if (id_byte3 < 0) {
-               printf("MouseInit: Timeout on 3rd byte of self-test report\n");
+               printf("MouseInit: Timeout on %s byte of self-test report\n", "3rd");
                return;
        }
        id_byte4 = (*getc)(mdev);
        if (id_byte4 < 0) {
-               printf("MouseInit: Timeout on 4th byte of self-test report\n");
+               printf("MouseInit: Timeout on %s byte of self-test report\n", "4th");
                return;
        }
        if ((id_byte2 & 0x0f) != 0x2)



Home | Main Index | Thread Index | Old Index