小智 16
如果你在gnome-terminal中运行emacs,gnome-terminal可能会捕获你的alt键来打开gui菜单(File,Edit,...).您可以通过选择编辑>>键盘快捷键...,并取消选中"启用菜单访问键..."来更改此行为.
在我的系统Ubuntu 9.04上,这可以让alt作为emacs的元数据.
回过头来的时候,好像很难将META键映射到ALT.那时我不得不使用xmodmap,这些是我必须放在.xmodmap文件中的东西.以下的一些变化始终有效(它取决于系统).我的.xinitrc文件已xmodmap在文件中读取.
!! Note the `!` are comment characters.
!! suggested to make Emacs work under VNC
keysym Alt_L = Meta_L
keysym Alt_R = Meta_R
!! xmodmap -e 'keysym Alt_L = Meta_L' -e 'keysym Alt_R = Meta_R'
!!
!! some environments still can't handle alt key properly
!! add this:
!!
clear Mod1
add Mod1 = Meta_L Meta_R
!! or
!! xmodmap -e "clear Mod1" -e "add Mod1 = Meta_L Meta_R"
Run Code Online (Sandbox Code Playgroud)