简体   繁体   English

如何在 Awesome WM 中编写键绑定序列?

[英]How can I code a keybindings sequence in Awesome WM?

My problem is that the basic option to make keybindings in Awesome WM (Window Manager), awful.key(), doesn't work for keybindings like [super+d, e] or [super+d, super+r].我的问题是,在 Awesome WM(窗口管理器)中进行键绑定的基本选项 awful.key() 不适用于 [super+d, e] 或 [super+d, super+r] 等键绑定。

I found a way to do it, but is impractical.我找到了一种方法来做到这一点,但这是不切实际的。 Maybe some parameter of "awful.keygrabber" works, but I can't find much information about its behavior.也许“awful.keygrabber”的某些参数有效,但我找不到有关其行为的太多信息。

This is how:这是如何:

awful.keygrabber {
    start_callback = function() --[[do something]]  end,
    stop_callback  = function() --[[do something]] end,

    -- You might want to avoid `export_keybindings` if you want
    -- a single point of entry. If so, they use a normal `awful.key`
    -- to start the keygrabber.
    export_keybindings = true,

    -- This is the important part, it releases the keygrabber
    -- when `Super` is released. If you don't want this and
    -- release when an unrelated key  is pressed, do it 
    -- with `keypressed_callback` instead.
    stop_event = "release",
    stop_key = {"Escape", "Super_L", "Super_R"},

    keybindings = {
        {{ modkey } , "d" , function()
            --[[do something]]
        end},
        {{ modkey } , "e" , function()
            --[[do something]]
        end},
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM