# (mostly) Keyboard only works when CAPS lock on



## phoenix (Nov 30, 2010)

Here's a strange one.  Just curious if anyone has ever come across anything similar.

My combined desktop/server at home, an older P4 with 2 GB of RAM running 32-bit FreeBSD 8-STABLE from a few weeks ago, locks up every couple of weeks for whatever reason.  No biggie, everything always come back after a reboot.  Until last week.

I have a generic USB keyboard and mouse plugged into an IOGear 2-port USB KVM+audio switch.  At the POST/BIOS screens, the keyboard works fine.  At the FreeBSD loader screen, the keyboard works fine.  At the console login prompt, the keyboard works fine.  At the KDM4 GUI login prompt, the keyboard works fine.  As soon as the GUI loads, the keyboard stops working.

Once the GUI is loaded, the only two key combinations that work are CTRL+ALT+F1 and CTRL+ALT+Backspace.  Every other key press just causes the cursor to blink without printing any characters.  Even Shift+key doesn't work.

*HOWEVER*, if you press CAPS lock, then all the keys work, and one can use SHIFT+key to get small letters.

Switching the KVM to the laptop, every key on the keyboard works at all times.

So, thinking it was something to do with Xorg keyboard driver, I reinstalled the X keyboard port.  No change.

Thinking that enabling HAL would help, I reinstalled the Xorg server port with HAL support, and enabled the Auto/Empty input options in xorg.conf.  Restarting X, the keyboard started to work again.

3 or 4 days later, the system locked up again (really need to track down whether it's heat-related).  And now the keyboard only work when CAPS lock is enabled.

I've played around with keyboard layouts and whatnot in KDE.  I've played around with keyboard options in xorg.  I've disabled HAL support in the X server.  I've even swapped USB ports around.  And it's still not working.

But, the keyboard works fine at the console, and when connected to the laptop.

Anyone ever come across something like this?  Anyone have any hints or suggestions on what else to look at?  It's got me and my friends completely stumped.


----------



## graudeejs (Nov 30, 2010)

And does it work well in twm or any other lightweight WM?
Did you check you startup scripts? (KDE startup apps etc)

I'd try lightweight WM, and from it start kdeinit....


----------



## richardpl (Nov 30, 2010)

After you are sure it is not software related it must be in hardware, or other way around.


----------



## wblock@ (Nov 30, 2010)

Does it work without the KVM?


----------



## DutchDaemon (Nov 30, 2010)

Just for fun, what happens when you activate CapsLock _before_ starting the GUI (so right after filling in the details in the KDM login prompt, I guess)? AnY DIFFERENCE?

O, sorry.


----------



## phoenix (Dec 1, 2010)

Next up on my list of things to try:

swap KVM connectors between laptop and desktop to see if the CAPS lock problem follows the cables
plug the keyboard directly into the desktop to see if the problem persists
It's just a real pain to thread the cables through the desk, which is why I haven't done that yet.

Side note:  anyone remember the name of the X app that lets you see the keycodes being sent from the keyboard to the X server?  That should help me figure out if the keyboard is even sending keycodes or not.


----------



## graudeejs (Dec 1, 2010)

xev(1)


----------



## aragon (Dec 1, 2010)

Something else to try: create a new user account and log into KDE with that.


----------



## phoenix (Dec 2, 2010)

killasmurf86 said:
			
		

> xev(1)



Thanks.  I'll have to try that tonight.

Update:  plugging the keyboard directly into a USB port on the computer doesn't change anything.  And plugging the keyboard directly into a USB port on the laptop makes everything work correctly.

Very strange.

Going to try a different keyboard tonight, as well as a new user, to see if I can narrow down where the issue is,


----------



## phoenix (Dec 3, 2010)

Definitely not the keyboard hardware itself.  Using a different USB keyboard, the same issues occur.

Will have to read up on xev() to see what's going on behind the scenes.

And try a new user to eliminate KDE settings issues.


----------



## phoenix (Dec 4, 2010)

So, it's definitely a KDE setting somewhere that is corrupted.  Created a new account, logged into KDE, keyboard worked.  Deleted account.  Renamed ~/.kde/ and ~/.kde4/ in my account, and now everything works again.  Very bizarre.

The fun part now is to figure out exactly which setting got corrupted.


----------



## graudeejs (Dec 4, 2010)

If you ask me:
KDE4 is not mature enough for normal desktop use.... (yet)

I tried KDE4 about month ago....
While some things are very appealing... some are more than annoying....  (like problems with corrupted settings. In about 2-3 days that I used it, I managed to corrupt settings. Don't know how, never cared... but that was definitely bug in KDE)
On the other hand, KDE as platform, is pretty sexy.... (not by it's looks)


----------



## expl (Dec 4, 2010)

Its because of the way kde creates configs, if you are using ufs for file system configs will get corrupted if the files are not flushed correctly before a crash.


----------



## graudeejs (Dec 4, 2010)

I was using zfs


----------



## expl (Dec 5, 2010)

It really depends how much was flushed back to disk, fragmented config files will lead to failure to load them.


----------



## kkt (Jan 10, 2016)

phoenix said:


> So, it's definitely a KDE setting somewhere that is corrupted.  Created a new account, logged into KDE, keyboard worked.  Deleted account.  Renamed ~/.kde/ and ~/.kde4/ in my account, and now everything works again.  Very bizarre.
> 
> The fun part now is to figure out exactly which setting got corrupted.



Were you able to figure out which setting it was that got corrupted?  I have the same problem.  Two user accounts on a PCBSD system with old config files get no lowercase letters, unless capslock is on and holding down the shift key, or before KDE is started.  A newly created user account does not have that problem.  But in my case, deleting .kde and .kde4 and letting them be recreated has not fixed the problem.  Rather not have to delete every config file.


----------



## phoenix (Jan 13, 2016)

No, I never did any more investigation into it once things started working.  And I don't have the broken .kde folders anymore to look into it.

Try also renaming the .config and .local folders, as various apps and frameworks store their configuration details in there as well.  And there may be other folders, like .gconf and such that may be worth renaming.  Basically, just rename one folder as a time until you find the one that's causing the issues.  

Good luck, and happy hunting!


----------



## Juha Nurmela (Jan 13, 2016)

x11/xkbutils contains program `xkbwatch`. Might help.

Juha


----------

