首页 > 解决方案 > AwesomeWm 我需要有关映射更多修饰键的建议

问题描述

我需要为键映射找到另外几个修饰符。Awesome Docs 声明有效的修饰符是 Any、Mod1、Mod2、Mod3、Mod4、Mod5、Shift、Lock 和 Control,其中一些我不清楚,但我尝试过 Capslock 和 Tab,但效果不佳。虽然绑定似乎有效,但我发现您仍然可以通过仅使用“键”部分来触发该功能,就好像修饰符被忽略一样。我知道我很可能不得不绘制这些地图,我希望我能得到一些关于从哪里开始的建议,提前感谢您的帮助

我在 Manjaro/Arch 上使用了很棒的 4.3 谢谢

clear mod4 
add mod4 = Super_L Hyper_L 
add mod3 = Super_R Menu
keycode 135 = Super_R Menu

和 cli xmodmap 的输出

xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3        Super_R (0x86),  Super_R (0x87)
mod4        Super_L (0x85),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

标签: awesome-wm

解决方案


You can see current modifiers with xmodmap in a terminal.

You can add Tab key to mod1 with: $ xmodmap -e "add mod1 = Tab"

Then you can use Mod1 in rc.lua, for example:

root.buttons = gears.table.join(
      ...
      ...
      awful.button({"Mod1"}, 1, function() naughty.notification({text="ok"}) end),
      ...
      ...
)

With holding Tab and pressing left mouse button, you pop up the notification.

Nevertheless, Tab will continue to tabulate... but if you want to change this behaviour, you may need to consider a xmodmap tutorial like this one.

In awesomeWM, you can find a table with your current modifiers. Below we can see that Tab has been added to the Mod1 table:

$ awesome-client "return awesome._modifiers.Mod1[1].keysym"
   string "Tab"
$ awesome-client "return awesome._modifiers.Mod1[1].keycode"
   double 23

Edit

With xmodmap to reassign Menu key to mod3:

clear mod1
add mod1 = Alt_L Meta_L
add Mod3 = Menu

More on xmodmap


推荐阅读