I often use the M-x command. Is it possible to bind it to my right shift (just the right shift, because I like my left shift the way it is)?
Alright, big thanks to the chosen answer. I solved the problem this way:
# Issued whenever the keyboard layout is changed.
xmodmap -e "keycode 62 = F13"
Then, in my Emacs config, I bind #'smex to <f13>. If you use the standard #'execute-extended-command, use the first (commented) line.
;; (global-set-key (kbd "<f13>") (function execute-extended-command))
(global-set-key (kbd "<f13>") (function smex))
xmodmapfor Linux,karabinerfor OSX, etc.) and then map that key. – Dan♦ Apr 27 '16 at 13:42