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?

0

1 Answer 1

2

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.

1
  • 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 that you have read and understand our privacy policy and code of conduct.

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