I have a Mac keyboard and trying to assign the backslash character to the "left shift + `" combination.

However the following code:

(global-set-key (kbd "S-`")                                                        

(defun insert_backslash ()                                                         
  (insert "\\"))   

creates the binding only for the right shift key. How do I assign it to the left shift instead?


1 Answer 1


What does C-h k tell you when you use that key (press and hold Left Shift and hit `)? It should tell you exactly what Emacs calls that key. Then use what it tells you as the arg to kbd.

  • ok, it prints ¬, so my code should be: (global-set-key (kbd "¬") 'insert_backslash) instead Jun 7, 2017 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.