XFCE4 Xmodmap Problem


Running X commands in XFCE4 at start up works, in theory. In practice, not. I had this problem for a while and searched for a solution, without success. Today I was reading through documents on XFCE website and found this entry.
Is it possible to use Media keys in the Shortcut Editor?
Use xmodmap to assign keycodes to your Media keys to make them available for the Xfce shortcut editor:
To determine keycodes of the multimedia keys use the program xev. Create a .Xmodmap file in your $HOME directory containing those keycodes and assign keysyms to them. All possible keysyms can be found in /usr/lib/X11/XKeysymDB or /usr/share/X11/XKeysymDB. 
To ensure that the .Xmodmap file is loaded when you start Xfce add /usr/bin/xmodmap $HOME/.Xmodmap to your .xinitrc or .xprofile file. When you start the shortcut editor the assigned keysyms should show up when you press one of your multimedia keys. Now it is possible to assign a command to them. 
Note: Several problems with auto-loading of .Xmodmap files at xfce startup have been reported (also when issued as autostart command). Search the xfce bugzilla sites for current problems. As a workaround, run xmodmap ~/.Xmodmap by hand every time, or try out editing the somewhat less straightforward xkb configuration files.
There you have it.