Can I bind something to ALT (Meta)

丶灬走出姿态 提交于 2019-12-31 04:43:25

问题


I've got:

(global-set-key '[f11] 'menu-bar-mode)

How can I bind it to left ALT / Meta and will there be conflicts of using alt as meta?


回答1:


You can't bind a function to a modifier key, because Emacs does not receive any input when a modifier key is pressed on its own (or more accurately, when one or more modifier keys are pressed without a non-modifier key also being pressed).

n.b. Your operating system determines which keys are modifiers, not Emacs.

You could probably tell your OS not to use the left Alt key as the Meta modifier and to instead send some sequence which you could then configure Emacs to recognise. You would want to configure some other key as the Meta modifier in that case of course, unless you are happy using right Alt exclusively.

I'm unsure precisely how you'd do that, but in a Unix-like OS reading up on xmodmap is typically the first port of call.



来源:https://stackoverflow.com/questions/26500567/can-i-bind-something-to-alt-meta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!