It could be a KDE thing. Check the file ~/.kde/share/config/kdeglobals and look for the settings for "Log Out" and "Log Out Without Confirmation". It's possible that one of those may be set to 'd'.
Thanks a million guys!
Went around this am, and this is what it was. Tried with IceWM first as suggested, and that was OK, so it pretty much had to be KDE. No idea how it can have happened, but its fixed now.
When resetting the configuration so that lock becomes (Ctrl+Alt+d) in a text editor, of course, the minute you type the 'd', it drops you to a locked session without making the change! So the only way to get the d in is to do cut and paste.
It is stuff like this that keeps blood flowing in the brain.
Cheers
Peter