2

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-`")                                                        
                'insert_backslash)                                                 

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

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

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 – Draif Kroneg Jun 7 '17 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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