At work I use a MacMini connected to an italian layout keyboard (please, look at the image)
I've discovered that Emacs doesn't insert the characters @
and #
when I use AltGr+ò and AltGr+à, respectively.
Any clue?
I have the following in my init.el to use the italian layout with Mac OS
;; Command key is Meta
(setq ns-command-modifier 'meta)
;; Option (alt) key used for special characters (e.g. []@#{}...)
(setq ns-alternate-modifier nil)
If you want to use the left Alt key as Meta and the right one to insert special characters you can set the following
;; AltGr used for special characters (e.g. []@#{}...)
(setq ns-right-alternate-modifier nil)
leaving the default values for ns-command-modifier
and ns-alternate-modifier
.
C-h k AltGr-ò
to determine what emacs receives. Maybe you can bind that to the required character by(global-set-key [...] (lambda () (interactive) "@"))
.(global-set-key (kbd "M-ò") (lambda () (interactive) "@"))
.