# Lost keyboard while in X

## jserink

Hi All:

Just before end of business today I lost my keyboard while in X windows. Its on a laptop and I lost both the external USB keyboard on the laptop as well. I had mouse control but no keyboard. I ssh'd in from my iPhone and killed my spice VM as I thought that was the problem but it was not, no keyboard.

Does anyone know of a way to get X to re-recognize the keyboard WITHOUT restarting X?

Cheers,

John

----------

## WvR

Without information as to what happened, it is impossible to diagnose the problem and thus it is impossible to judge whether or not a restart of X is necessary.

From my experience, the common cause is that you have updated Xorg or something related to Xorg, and did not recompile the evdev driver. So, you can try 

```

emerge xf86-input-evdev

```

but then you have to restart X to make everything work again.

----------

## jserink

 *WvR wrote:*   

> Without information as to what happened, it is impossible to diagnose the problem and thus it is impossible to judge whether or not a restart of X is necessary.
> 
> From my experience, the common cause is that you have updated Xorg or something related to Xorg, and did not recompile the evdev driver. So, you can try 
> 
> ```
> ...

 

Thanx for the reply WVR.

I didn't update anything, I was scrolling through the columns in excel 2010 inside a windows 7 VM running under spice and qemu 1.22. The spreadsheet went crazy continually spooling and the keyboard was gone. I still had mouse control but no keyboard, both USB external and the laptop native. I removed the USB key board and readded it, no effect. I had two bash consoles open and neither would record any keystrokes. It was done.

I brought up task manager (xfce4.10) and killed the qemu vm and I still didn't get the keyboard back. I exited X using the mouse to logout and I had my keyboard back.

My purpose of the post is to see if there is anyway I could get the keyboard back with closing X.

I guess I should also change my login to start the VM before X so that is I have to  lose X I don't lose the VM.

Cheers,

John

----------

## jamapii

ok, so this is old, but my "lost keyboard" problem is just as old.

To me it happens only when cairo-dock is running. If it has happened once, cairo-dock remembers this state and restores it after a reboot into X when and only when the current VT is running the X server.

So the workaround is to switch VT after xdm has started X, but before cairo-dock is starting. Switch to VT1 (or VT2 if you use my inittab improvement), login and kill all cairo-dock processes. You can then switch to X. How to get back to correct state I don't remember. Either just restart cairo-dock, or remove it temporarily from [your startup script or whatever], reboot, and start it manually, or something else...

The symptom is that the mouse works, but no keys, not even the power button does anything. If you use an onscreen keyboard, its keys don't work either. Only ssh or a brute-force poweroff can be used to regain control.

It happens every few weeks or months.

But cairo-dock is currently dead for me.

----------

## jserink

Interesting, but I just checked, I don;t have cairo-dock installed...

So must be something else.

Hasn't happen in about 3 months.

Cheers,

john

----------

