Subject: Re: about: caps lock
To: None <port-mac68k@NetBSD.ORG>
From: Stephen C. Brown <sbrown@shellx.best.com>
List: port-mac68k
Date: 11/17/1996 23:15:04
Hi,

I was kind of annoyed by the same thing that you are complaining about.
I have patched it in my source and am attaching my patch to the end of
this email.  Basically, the patch is just a few lines changed in the
"/usr/src/sys/arch/mac68k/dev/ite.c" file in the kernel source.

The drawback to my patch is that, with it applied, all keys are affected
by the caps lock key.  In a proper, sane environment only alphabetic
keys are affected by the caps lock key and you have to press the shift key
to modify number keys, etc.  But, I've been trying to figure a clean way
of fixing that.  Since the alphabetic key codes are noncontiguous, it makes
it more difficult.  Also a problem is that I'm not sure what the alphabetic
key code ranges are for international keyboards.  Maybe someone else can
take my patch and run with it.

I have tested the patch with both an adesso TruForm ergonomic keyboard
and an Apple Extended Keyboard II.  It seems to work equally well on
either one.

Let me know if you see any problems with it.

Steve Brown,
sbrown@best.com

p.s.  If someone knows how to set the adb register # 2 bits to get the
        "caps lock" led to work, that would be a nice addition.  I didn't
        have a lot of time to play around with the adbioctl() calls, etc.

>>On Thu, 14 Nov 1996, synapse wrote:
>>
>>> has anyone out there noticed that the caps lock key serves no function in
>>> NetBSD? or is my keyboard just broken?
>>
>>The caps lock key on my Apple Keyboard II connected to my SE/30 runnning
>>stock 1.2 doesn't work on the console but it does work under dt 1.1.5.
>>
>I am noticing the same thing.
>i'm accustomed to using dt these past few days, so it's not much of a
>problem anyway...
>  - a

------Patch starts here---------------------------------------------------------
*** ite.c.orig  Sat Nov 16 23:17:48 1996
--- ite.c       Sat Nov 16 23:52:28 1996
***************
*** 1058,1064 ****
  int
  ite_intr(adb_event_t * event)
  {
!       static int shift = 0, control = 0;
        int key, press, val, state;
        char str[10], *s;

--- 1058,1064 ----
  int
  ite_intr(adb_event_t * event)
  {
!       static int shift = 0, control = 0, capslock = 0;
        int key, press, val, state;
        char str[10], *s;

***************
*** 1066,1072 ****
        press = ADBK_PRESS(key);
        val = ADBK_KEYVAL(key);

!       if (val == ADBK_SHIFT)
                shift = press;
        else if (val == ADBK_CONTROL)
                control = press;
--- 1066,1074 ----
        press = ADBK_PRESS(key);
        val = ADBK_KEYVAL(key);

!       if (val == ADBK_CAPSLOCK)
!               capslock = !capslock;
!       else if (val == ADBK_SHIFT)
                shift = press;
        else if (val == ADBK_CONTROL)
                control = press;
***************
*** 1098,1104 ****
                        break;
                default:
                        state = 0;
!                       if (shift)
                                state = 1;
                        if (control)
                                state = 2;
--- 1100,1108 ----
                        break;
                default:
                        state = 0;
!                       if (shift && capslock)
!                               state = 0;
!                       else if (shift || capslock)
                                state = 1;
                        if (control)
                                state = 2;