使用 xkb 将 AltGr 重新映射到 Insert

使用 xkb 将 AltGr 重新映射到 Insert

我想重新映射我的(联想)键盘上的按键。我想有InsertunderAltGr键。

我的键盘

例如,我END在键盘上的按钮下有右 CTRL 键。

key  <END> {    [  Control_R   ]   }; 

我认为LVL3MDSW负责映射AltGr

    key <LVL3> {        [ Insert        ]       };
    key <MDSW> {        [ Insert        ]       };

但它不起作用。

我的 XKB 配置 /usr/share/X11/xkb/符号/pc

default  partial alphanumeric_keys modifier_keys
xkb_symbols "pc105" {

    key <ESC>  {    [ Escape        ]   };

    // The extra key on many European keyboards:
    key <LSGT> {    [ less, greater, bar, brokenbar ] };

    // The following keys are common to all layouts.
    key <BKSL> {    [ backslash,    bar ]   };
    key <SPCE> {    [    space      ]   };

    include "srvr_ctrl(fkey2vt)"
    include "pc(editing)"
    include "keypad(x11)"

    key <BKSP> {    [ BackSpace, BackSpace  ]   };

    key  <TAB> {    [ Tab,  ISO_Left_Tab    ]   };
    key <RTRN> {    [ Return        ]   };

    key <CAPS> {    [ Caps_Lock     ]   };
    key <NMLK> {    [ Num_Lock      ]   };

    key <LFSH> {    [ Shift_L       ]   };
    key <LCTL> {    [ Control_L     ]   };
    key <LWIN> {    [ Super_L       ]   };

    key <RTSH> {    [ Shift_R       ]   };
    key <RCTL> {    [ End           ]   };
    key <RWIN> {    [ Super_R       ]   };
    key <MENU> {    [ Menu          ]   };

    // Beginning of modifier mappings.
    modifier_map Shift  { Shift_L, Shift_R };
    modifier_map Lock   { Caps_Lock };
    modifier_map Control{ Control_L, Control_R };
    modifier_map Mod2   { Num_Lock };
    modifier_map Mod4   { Super_L, Super_R };

    key <LVL3> {        [ Insert        ]       };
    key <MDSW> {        [ Insert        ]       };
    modifier_map Mod5   { <LVL3>, <MDSW> };

    key <ALT>  {    [ NoSymbol, Alt_L   ]   };
    include "altwin(meta_alt)"

    key <META> {    [ NoSymbol, Meta_L  ]   };
    modifier_map Mod1   { <META> };

    key <SUPR> {    [ NoSymbol, Super_L ]   };
    modifier_map Mod4   { <SUPR> };

    key <HYPR> {    [ NoSymbol, Hyper_L ]   };
    modifier_map Mod4   { <HYPR> };
    // End of modifier mappings.

    key <OUTP> { [ XF86Display ] };
    key <KITG> { [ XF86KbdLightOnOff ] };
    key <KIDN> { [ XF86KbdBrightnessDown ] };
    key <KIUP> { [ XF86KbdBrightnessUp ] };
};

hidden partial alphanumeric_keys
xkb_symbols "editing" {
    key <INS> {
    type= "PC_ALT_LEVEL2",
    symbols[Group1]= [ Print, Sys_Req ]
    };
    key <SCLK> {    [  Scroll_Lock      ]   };
    key <PAUS> {
    type= "PC_CONTROL_LEVEL2",
    symbols[Group1]= [ Pause, Break ]
    };
    key <HOME> {    [  Alt_L        ]   };
    key <PRSC> {    [  Home         ]   };
    key <PGUP> {    [  Prior        ]   };
    key <DELE> {    [  Delete       ]   };
    key  <END> {    [  Control_R        ]   };
    key <PGDN> {    [  Next         ]   };

    key   <UP> {    [  Up           ]   };
    key <LEFT> {    [  Left         ]   };
    key <DOWN> {    [  Down         ]   };
    key <RGHT> {    [  Right        ]   };
};

xev按键结果AltGr

KeyRelease event, serial 37, synthetic NO, window 0x3a00001,
    root 0xf5, subw 0x0, time 652866, (315,347), root:(1186,806),
    state 0x80, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
    XKeysymToKeycode returns keycode: 92
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

有人能给我一些建议吗,pc我应该更改文件中的哪个键?

相关内容