You can send commands to kwm with either:
KWM::sendKWMCommand(QString) (in KDE applications) or kwmcom command (from the command line)
This is especially of interest for kglobalshortcut developers.
At present kwm understands the following commands:
refreshScreen refreshes the screen
darkenScreen turns the screen dark. Careful: this one makes the desktop unresponsive to keyboard/mouse input.
logout displays the logout dialog.
commandLine opens the mini command-line window
taskManager displays the "Current Session" manager.
configure reloads configuration from kwmrc.
winMove
winResize
winRestore
winIconify
winClose
winShade
winSticky
winOperations
deskUnclutter
deskCascade
desktop[1-8] switches to the specified desktop
desktop+1
desktop+2
desktop-1
desktop-2
desktop%2
go:other The go command exits kwm and all its modules and launches other instead. other can for example be the name of another window manager such as fvwm. Note: you cannot pass a path to the go-command but only the executable name, since kwmcom is limited to 20 characters.