<div dir="ltr">sorry for the slow update.<div>my controller is indeed the i8042. however, the current version of ubuntu has kernel 2.6.31 which does not have the i8042_filter() function yet. the advantige of keeping the kernel with ubutu's configuration is that all the tuning they've done to get esoteric hardware to work out of the box remains. as my laptop is mostly esoteric hardware (HP tx2000), it made more sense then to try a new kernel and both try to debug my changes and the kernel config options at the same time.</div>
<div><br></div><div>after some useful information from <a href="http://gunnarwrobel.de/wiki/Linux-and-the-keyboard.html" target="_blank">this article</a> and the specification links it led to, i concluded that the scancode in my system for caps lock is 0x3a, and placed the following code near the beginning of the function i8042_interrupt(). <br>
<span style="font-family: courier new,monospace;"> if(data == 0x3a)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> goto out;</span><br>while this fixed the caps-lock, it made the mouse and tablet go crazy. upon further thought, i changed it to this:<br>
<span style="font-family: courier new,monospace;"> if(data == 0x3a && port_no == I8042_KBD_PORT_NO)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> goto out;</span><br>
a vast improvement. still, some "special" keys acted wrong, so i ended up moving it to near the end of the code. <br><br>and thanks to rami for pointing me in the right direction.<br><br><div class="gmail_quote">
On Sat, Mar 20, 2010 at 13:49, Rami Rosen <span dir="ltr"><<a href="mailto:rosenrami@gmail.com" target="_blank">rosenrami@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi, Boaz,<br>
<br>
I suggest that you'll look at the interrupt handler of the keyboard.<br>
Usually, the i8042 chip family is the keyboard controller in desktops<br>
and laptops.<br>
First make sure that i8042 is indeed the driver you are using; run cat<br>
/proc/interrupts and see whether<br>
interrupt number 1 (the keyboard interrupt) is handled by i8042.<br>
Then goto drivers/input/serio/i8042.c; i8042_interrupt() is the<br>
handler for keyboard interrupts. You can try add a filter there for<br>
Caps Lock.<br>
<br>
Even better is try to add code in i8042_filter() method, which is<br>
called from i8042_interrupt(); this way you can be sure about locking.<br>
<br>
I think that you should **not** try to write a simple module which<br>
hookskeyboard interrupts. While this solution is usually better (you<br>
don't change kernel code), I think it won't work in this case.<br>
Namely, if you try something like this, in a kernel module:<br>
<br>
free_irq (1, NULL);<br>
res = request_irq (1, mykbdhandler, IRQF_SHARED, "mykbd", dev_id);<br>
<br>
I think you will get an error, since<br>
interrupt 1 (the PC keyboard interrupt) is edge-triggered (see cat<br>
/proc/interrupts;<br>
for interrupt 1 it says:"IO-APIC-edge" ). In<br>
case of level-triggered interrupts this might have been OK.<br>
<br>
<br>
Rgs,<br>
Rami Rosen<br>
<div><div></div><div><br>
<br>
On Sat, Mar 20, 2010 at 3:19 AM, boazg <<a href="mailto:boaz.gezer@gmail.com" target="_blank">boaz.gezer@gmail.com</a>> wrote:<br>
> hi,<br>
> i have a laptop in which due to a hardware problem, computer thinks the caps<br>
> lock key is pressed about 5 times a second, at random. i've disabled caps<br>
> lock at the X11 level, and it's now usable. however, a few programs still<br>
> have problems with the fact that a key is pressed (regardless of it being<br>
> caps lock). also, i can't use the consoles at ctrl+alt+f[1..6].<br>
> i wanted to have the kernel filter out caps lock and have the userland never<br>
> see that is was pressed. to this end i edited drivers/char/keyboard.c and<br>
> added a few spots where i return if the key is caps lock. this doesn't seem<br>
> to work.<br>
> anyone have any better ideas as to where i should be looking?<br>
><br>
> thanks<br>
><br>
> boazg<br>
><br>
</div></div>> _______________________________________________<br>
> Haifux mailing list<br>
> <a href="mailto:Haifux@haifux.org" target="_blank">Haifux@haifux.org</a><br>
> <a href="http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux" target="_blank">http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux</a><br>
><br>
><br>
</blockquote></div><br></div></div>