【问题标题】:Make Alt_R an Alt (A-) modifier key (instead of a Meta (M-) modifier key)使 Alt_R 成为 Alt (A-) 修饰键(而不是 Meta (M-) 修饰键)
【发布时间】:2012-04-21 01:29:04
【问题描述】:

我想将Alt_L 设置为META(即emacs 中的M-),但将Alt_R 设置为ALT。如何修改.Xmodmap 和/或.emacs 来实现这一点?

【问题讨论】:

    标签: emacs x11 xmodmap


    【解决方案1】:

    下面是我的.Xmodmap。它并没有完全实现您的规范,但应该让您了解如何实现它。在您的情况下,只有 Sec-2 需要修改;假设您的键盘与我的键盘相似,则此部分只需要一行:keycode 108 = Alt_R,因为 X-server 已经将Alt_L 识别为Meta_L

    这是我的.Xmodmap,它使 Emacs 识别的所有修饰符都可用(Alt、Meta、Super、Hyper、Control、Shift):

    !!! Implement the following layout:
    !!!     Alt  A S D F ...
    !!!     Shift Z     X    C V B N M ...
    !!!     Hyper Super Meta --Space-- Control Super Hyper
    
    !!! by transforming from the conventional layout:
    !!!     Caps:66
    !!!     Shift
    !!!     Ctrl:37 Win:133 Alt:64 Space AltGr:108 Menu:135 Ctrl:105
    
    !! Sec-1.
    clear Control
    clear Lock
    clear mod1
    clear mod2
    clear mod3
    clear mod4
    clear mod5
    
    !! Sec-2. System dependent; use xev to find the exact keycodes:
    keycode  37 = Hyper_L
    keycode  64 = Meta_L
    keycode  66 = Alt_L
    keycode 105 = Hyper_R
    keycode 108 = Control_R
    keycode 135 = Super_R
    
    !! Sec-3.
    add Control = Control_L Control_R
    add mod1 = Meta_L Meta_R
    add mod2 = Hyper_L Hyper_R
    add mod3 = Num_Lock
    add mod4 = Alt_L Alt_R Multi_key
    add mod5 = Super_L Super_R Mode_switch
    

    【讨论】:

      【解决方案2】:

      这是我当前的 .xmodmaprc,它可能需要一些工作,但说明了如何使用不同的修饰符更改特定的键(使用 ksysym 关键字)。我关闭了 cedilla(西班牙语键盘)并在其中放置了一个斜杠/反斜杠等。

      pointer = 3 2 1 4 5 6 7 8 9 10
      
      clear Mod4
      remove Lock = Caps_Lock
      remove Control = Control_L
      remove Mod5 = ISO_Level3_Shift
      
      keysym ccedilla = slash backslash NoSymbol NoSymbol braceright
      keysym 3 = 3 numbersign NoSymbol NoSymbol periodcentered
      keysym 1 = 1 exclam NoSymbol NoSymbol masculine
      
      keysym 0xba = bar
      ! the next one is neccesary becuase the above command
      ! modifies the m key too!
      keysym 0x6d = m
      
      keysym Control_L = Super_L
      keysym Caps_Lock = Control_L
      keysym ISO_Level3_Shift = Hyper_L
      keysym Super_L = ISO_Level3_Shift
      
      add Lock = Caps_Lock
      add Control = Control_L
      add Mod4 = Super_L
      add Mod4 = Super_R
      add Mod3 = Hyper_L
      add Mod3 = Hyper_R
      add Mod5 = ISO_Level3_Shift
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-06-30
        • 2017-05-25
        • 1970-01-01
        • 1970-01-01
        • 2012-05-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多