Well, what you do is simply:
sudo kdmctl -g login :0 now username passwordWhat does that do? The -g lets it connect using the global unix domain socket.
The login means exactly that, log in.
:0 - This tells kdm that you'd like it to happen on display 0.
now - well, it means now.
username and password would be the username and password you normally use to log into your kde desktop.
Sure as heck saves me a lot of backaches from crawling under the table just to reconnect the mouse and keyboard.
|My work set-up.|