Help - Search - Members - Calendar
Full Version: Caps_lock
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > OpenBSD
iamasmith
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 sad.gif 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 smile.gif
iamasmith
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 tongue.gif

- Andy
iamasmith
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 sad.gif

The wskbd patch is also attached here for your convenience..
iamasmith
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.. tongue.gif

Again for your convenience..

Click to view attachment

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).

Click to view attachment

and the md5sum for that file..

Click to view attachment
iamasmith
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 tongue.gif

- Andy
mathemajikian
The path stated below in post # 4 of this thread should be /usr/X11R6/lib/modules/input rolleyes.gif Thanks for providing this patch! Why has this not been added to a release yet?

QUOTE(iamasmith @ Feb 11 2006, 12:53 PM)
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).
mathemajikian
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
iamasmith
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.