使用单引号 (') 作为变量值

Use single quotes ( ' ) as a variable value

我最近安装了 qtile,它是在 python 中编写和配置的,我习惯于使用包含单引号 ' 的键绑定。此命令有效:

    Keys = [
        Key(
            ["mod4"], "m",
            lazy.screen.next_group()
        ),
    ]

我想要这样的东西:

    Keys = [
        Key(
            ["mod4"], "'",               # <<- "m" got replaced by single quote
            lazy.screen.next_group()
        ),
    ]

它与 m 完美配合,但如果我将其更改为 ',则效果不佳。我可以修复它还是必须更改绑定?

个人对qtile不熟悉,但来自the docs:

Special keys

These are most commonly used special keys. For complete list please see the code. You can create bindings on them just like for the regular keys. For example Key(["mod1"], "F4", lazy.window.kill()).

还有一个 link 到这里:https://github.com/qtile/qtile/blob/master/libqtile/xkeysyms.py,它在特殊键列表中声明 'apostrophe': 0x0027,

这一切都向我暗示,要绑定单引号,您必须使用如下内容:

 Keys = [
    Key(
        ["mod4"], "apostrophe",
        lazy.screen.next_group()
    ),
]