Subject: Re: Swapping CapsLock and Control Keys
To: Alistair G. Crooks <agc@uts.amdahl.com>
From: Wayne Berke <berke@panix.com>
List: port-i386
Date: 03/03/1995 18:27:33
In message <m0rk9Vf-0000KjC@amdahl.uts.amdahl.com>, Alistair G. Crooks writes:
> The following diff swaps the CapsLock and Control keys depending upon
> whether you have an "options CAPS_IS_CONTROL" line in your kernel
> config file.  I'm told that BSDi do it that way.  On my keyboard, the
> LEDs are switched too - the Caps Lock LED lights up whenever the
> (logical) Caps Lock key is selected - i.e. the CapsLock LED follows
> the logical CapsLock key.  This has advantages over xmodmap-type of
> solutions, which illuminate the LED whenever the physical CapsLock key
> (to the right of 'A') is pressed, even if you've mapped it to
> something else.  Obviously, this only works if you're using pccons.
> 
> Cheers,
> Alistair

Thanks!  But while we're at it why not a similar patch for pcvt users?
Look Ma, no .Xmodmap!  :-)

*** 1.1	1995/03/03 22:46:29
--- pcvt_kbd.c	1995/03/03 23:12:21
***************
*** 297,303 ****
--- 297,307 ----
  /* 27*/ KBD_ASCII, I, {S,C "["},     {S,C "{"},     {S,C "\033"},
  /* 28*/ KBD_ASCII, I, {S,C "]"},     {S,C "}"},     {S,C "\035"},
  /* 29*/ KBD_ASCII, I, {S,C "\\"},    {S,C "|"},     {S,C "\034"},
+ #ifndef CAPS_IS_CONTROL
  /* 30*/ KBD_CAPS,  I, {S,C ""},      {S,C ""},      {S,C ""},
+ #else
+ /* 30*/ KBD_CTL,   I, {S,C ""},      {S,C ""},      {S,C ""},    /* CTL left */
+ #endif
  /* 31*/ KBD_ASCII, I, {S,C "a"},     {S,C "A"},     {S,C "\001"},
  /* 32*/ KBD_ASCII, I, {S,C "s"},     {S,C "S"},     {S,C "\023"},
  /* 33*/ KBD_ASCII, I, {S,C "d"},     {S,C "D"},     {S,C "\004"},
***************
*** 325,331 ****
--- 329,339 ----
  /* 55*/ KBD_ASCII, I, {S,C "/"},     {S,C "?"},     {S,C "/"},
  /* 56*/ KBD_NONE,  I, {S,C ""},      {S,C ""},      {S,C ""},
  /* 57*/ KBD_SHIFT, I, {S,C ""},      {S,C ""},      {S,C ""}, /* SHIFT right */
+ #ifndef CAPS_IS_CONTROL
  /* 58*/ KBD_CTL,   I, {S,C ""},      {S,C ""},      {S,C ""},    /* CTL left */
+ #else
+ /* 58*/ KBD_CAPS,  I, {S,C ""},      {S,C ""},      {S,C ""},
+ #endif
  /* 59*/ KBD_ASCII, I, {S,C ""},      {S,C ""},      {S,C ""}, 
  /* 60*/ KBD_META,  I, {S,C ""},      {S,C ""},      {S,C ""},    /* ALT left */
  #if !PCVT_NULLCHARS