Author Topic: Caps_lock  (Read 5726 times)

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Caps_lock
« on: February 09, 2006, 09:28:23 pm »
Ok, I have spend ages trying to get a better solution than the one below and if someone can correct me then I will be a happy guy.

It seems that the Caps flag (8) gets reset to 0 if another Shift value is present on the keyboard, Using xev you can definitely see that Fn+Tab generates Caps_Lock but the state only shows 0x80 (Fn generates that) instead of 0x88 as the keyboard toggle kicks in. I guess this is a limitation of how zkbd works  something else to look at then.

My only solution to Caps_Lock in the meantime is to use that Japanese key next to the Minus key with an xmodmaprc as follows..

remove lock = Caps_Lock
keycode 8 = Caps_Lock
add lock = Caps_Lock

It actually works reasonably well and is the only key that up until that point didn't have a use.

So PLEASE if you have a better solution tell me.
- Andy
« Last Edit: February 11, 2006, 07:58:27 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Caps_lock
« Reply #1 on: February 10, 2006, 08:06:47 am »
btw if you want to have that key mapped to caps lock at the console then...

wsconsctl -w keyboard.map+="keycode 22=Caps_Lock"

does the trick...

still looking into getting it working properly though

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Caps_lock
« Reply #2 on: February 10, 2006, 09:55:10 am »
I produced a proper fix for the Console, with this compiled in you will get Caps Lock using Fn+Tab.

http://marc.theaimsgroup.com/?l=openbsd-te...58309202645&w=2

now I need to take a look at the X keyboard drivers and since I have never built X on OpenBSD before it may  take longer (read as "it's going to") to do the initial build than to find a fix

The wskbd patch is also attached here for your convenience..
« Last Edit: February 10, 2006, 10:58:52 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Caps_lock
« Reply #3 on: February 11, 2006, 07:53:23 am »
And here's the fix I made for X11

http://marc.theaimsgroup.com/?l=openbsd-te...66203312579&w=2

heh, it took over night to build my initial X distribution before I could test the patch and post it..

Again for your convenience..



and a precompiled module against XOrg 6.9 from 3.9 beta (-current) make sure you rename it to kbd_drv.so and it goes into /usr/X11R6/modules/input (rename original first as your safety backup).



and the md5sum for that file..

 [ Invalid Attachment ]
« Last Edit: February 11, 2006, 07:57:44 am by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Caps_lock
« Reply #4 on: February 11, 2006, 08:31:07 am »
Oh, I forgot to mention, since the X keyboard driver handles Caps state independently of the console driver, if you only want Caps in X then you shouldn't need to build the kernel with the patch.

I had a reponse also from Moid Vallat acknowledging the fix for the console so expect that either my fix or one he suggested will eventually get committed to the kernel CVS.

Only just posted the X fix so we shall see if we get any responses

- Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Caps_lock
« Reply #5 on: September 10, 2006, 07:21:04 pm »
The path stated below in post # 4 of this thread should be /usr/X11R6/lib/modules/input    Thanks for providing this patch! Why has this not been added to a release yet?

Quote
and a precompiled module against XOrg 6.9 from 3.9 beta (-current) make sure you rename it to kbd_drv.so and it goes into /usr/X11R6/modules/input (rename original first as your safety backup).
« Last Edit: September 16, 2006, 09:15:10 am by mathemajikian »

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Caps_lock
« Reply #6 on: September 16, 2006, 02:23:01 pm »
To apply Andy's CAPS_LOCK console patch I just copied zauruscaps_wskbd.c.patch to /usr/src/sys/dev/wscons/ and then followed Andy's directions in the quote below:

Quote
apply the patch in wscons directory with:

patch -p0 < zauruscaps_wskbd.c.patch

Then compile and install the kernel as usual.

-Andy
« Last Edit: September 16, 2006, 02:28:06 pm by mathemajikian »

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Caps_lock
« Reply #7 on: September 17, 2006, 06:02:02 am »
ok, I mailed the tech@ group last night and got a response from Theo, initially the response was..

Quote
Wierd. I've never seen this (these)  patches before.

and after he did a little more digging, when I mentioned that Miod had also proposed a an alternate fix...

Quote
There are large problems with our wscons keymap stuff not being able to deal with that nightmare of a keyboard. It is rather ugly to deal with.
Yes, talk to him in a few weeks, and keep talking to him every 2-3 weeks.

A translation of that for the folks that haven't spent time with the wscons source code is really that wscons (as is most of the Kernel source) is actually quite cleanly and simply implemented. It is good clean code, nicely written and easily read but doesn't handle the case scenario for wierd keyboards that don't have dedicated lock keys such as Caps or Num lock.

My fix implements the Caps Lock in an early part of wscons and duplicates some effort that the wscons driver performs a little later so it is feasible that a good rework of wscons could handle this keyboard and a few others in a nice clean manner that doesn't offend the standards of the project. For now that means that the patch is 'apply it seperately' if you need it and if you don't then don't bother.

Note that the code we are considering for the wscons fix is core OpenBSD code and nothing specific to the Zaurus... Zaurus specific hacks for certain things would be ugly and perhaps only just bearable in the Zaurus specific portions of the tree, however, they would clearly be unacceptable in the main portion of the source tree.

X is a different matter, however, it seems that very few folks like the XOrg source and Theo makes no comment on that patch. XOrg uses raw keyboard handling and manages Caps Lock state independently of the Kernel state which is ugly in its own right.. it may be that Matthieu who maintains the XOrg part of OpenBSD could be swayed to take a look at the patch, however, I acknowlege that it is a little ugly in the way that it works and he may not have much time to fix it in a cleaner way.

For now the message really is if you want Caps Lock under Console and or X, consider implementing these patches.

-Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card