我正在尝试将全选行为重新映射ctrl+a
到super+a
使用 gtk,因为chromium
它是用 gtk 构建的。我在~/.config/gtk3.0/gtk.css
@binding-set SuperBindings {
bind "<Super>x" { "cut-clipboard" () };
bind "<Super>v" { "paste-clipboard" () };
bind "<Super>c" { "copy-clipboard" () };
bind "<Super>f" { "enable-search" () };
}
@binding-set SelectAll {
bind "<Super>a" { "select-all" () };
}
@binding-set TextViewSelectAll {
bind "<Super>a" { "select-all" (TRUE) };
}
@binding-set TextMovementBindings {
bind "<Control>n" { "move-cursor" (display-lines, 1)};
bind "<Control>p" { "move-cursor" (display-lines, -1)};
}
@binding-set WindowBindings {
bind "<Super>q" { "close" ()};
}
@binding-set EntrySelectAll {
bind "<Super>a"
{
"move-cursor" (paragraph-ends, -1, 0)
"move-cursor" (paragraph-ends, 1, 1)
};
}
entry {
-gtk-key-bindings: SuperBindings, TextMovementBindings, WindowBindings, EntrySelectAll;
}
window {
-gtk-key-bindings: WindowBindings;
}
text {
-gtk-key-bindings: TextMovementBindings;
}
textview {
-gtk-key-bindings: SuperBindings, TextMovementBindings, TextViewSelectAll;
}
treeview {
-gtk-key-bindings: SelectAll;
}
iconview {
-gtk-key-bindings: SelectAll;
}
listbox {
-gtk-key-bindings: SelectAll;
}
flowbox {
-gtk-key-bindings: SelectAll;
}
label {
-gtk-key-bindings: SuperBindings, TextMovementBindings;
}
使用此配置,我能够super+a
选择所有文本,但无法选择搜索栏(DOM 中)中的文本。我错过了什么?