In KDE you cannot assign special functions to the right control key or Caps Lock. You can only attach something to Print Screen.
First off, you should write a Bash script. I'll take Kopete as an example.
|
Source code
|
1
2
3
4
5
6
|
export DISPLAY=:0
if pgrep kopete; then
dcop kwin default setCurrentDesktop 3
else
kopete &
fi
|
A second note, which is really worth mentioning, is that it is not possible to move to the right desktop with a given window. In the script, I assume that Kopete always should reside on desktop 3. You can enforce Kopete to start there with window specific rules (right click on random title bar, Configure Window Behaviour->Window Specific Settings).
Once you created the script, add an entry for this in the K Menu. Run kmenueedit, create an entry pointing to that script. There you can also assign a shortcut.