How do I remap META to ALT?

后端 未结 6 2015
渐次进展
渐次进展 2021-02-07 23:59

I am using emacs in Ubuntu. How can I remap META to the ALT key?

相关标签:
6条回答
  • 2021-02-08 00:03

    If using a Mac, open up terminal then navigate to Terminal > Preferences. Under the profiles tab, check the checkbox on Use Option as Meta Key. See screenshot

    user option as Meta key

    That should do the trick.

    0 讨论(0)
  • 2021-02-08 00:06

    Start your VNC server with the -compatiblekbd option.

    See link here.

    0 讨论(0)
  • 2021-02-08 00:15

    Use xkeycaps to look at your keyboard mapping and swap the META and ALT modifiers, or just swap the entire keys. Because GNOME has some assumptions about which keys have META and ALT modifiers, it'll probably make your life easier to swap the keys entirely.

    xkeycaps should be available as an ubuntu package.

    0 讨论(0)
  • 2021-02-08 00:24

    Way back when, it did seem that the META key was difficult to map to the ALT. At that time I had to use xmodmap, and these were the things I had to put in my .xmodmap file. Some variation of the following always worked (it depended on the system). My .xinitrc file would have xmodmap read in the file.

    !! 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"
    
    0 讨论(0)
  • 2021-02-08 00:27

    Usually Meta is mapped to the Alt key by default.

    What is displayed in the echo area at the bottom of the Emacs window when you type Alt+X? If you see M-x then Alt is working as Meta.

    0 讨论(0)
  • 2021-02-08 00:27

    If you run emacs in a gnome-terminal, the gnome-terminal may be capturing your alt key to open the gui menu (File, Edit, ...). You can change this behavior by selecting Edit >> Keyboard Shortcuts ..., and unchecking `Enable menu access keys ...'.

    On my system, Ubuntu 9.04, this lets alt serve as meta for emacs.

    0 讨论(0)
提交回复
热议问题