mod actions_table;
mod keybindings;
mod keyboard;
mod mouse;
mod selection;
mod word_selection;
use crate::SettingsUI;
use crate::section::section_matches;
use std::collections::HashSet;
pub use keybindings::capture_key_combo;
pub(crate) use keybindings::display_key_combo;
pub fn show(
ui: &mut egui::Ui,
settings: &mut SettingsUI,
changes_this_frame: &mut bool,
collapsed: &mut HashSet<String>,
) {
let query = settings.search_query.trim().to_lowercase();
if section_matches(
&query,
"Keyboard",
&[
"option",
"alt",
"meta",
"esc",
"physical",
"keyboard layout",
"terminal applications",
],
) {
keyboard::show_keyboard_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Modifier Remapping",
&[
"remap",
"swap",
"ctrl",
"super",
"cmd",
"modifier",
"left ctrl",
"right ctrl",
"left alt",
"right alt",
],
) {
keyboard::show_modifier_remapping_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Mouse",
&[
"scroll",
"scroll speed",
"double-click",
"triple-click",
"focus follows",
"option+click",
"alt+click",
"horizontal scroll",
],
) {
mouse::show_mouse_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Selection & Clipboard",
&[
"copy",
"paste",
"middle-click",
"auto-copy",
"delay",
"trailing newline",
"quote style",
"drop files",
"dropped file",
],
) {
selection::show_selection_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Clipboard Limits",
&["max", "sync", "bytes", "clipboard events", "limit"],
) {
selection::show_clipboard_limits_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Word Selection",
&[
"word characters",
"smart selection",
"patterns",
"urls",
"emails",
"paths",
],
) {
word_selection::show_word_selection_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Copy Mode",
&[
"copy mode",
"vi",
"vim",
"yank",
"visual",
"selection mode",
"keyboard-driven",
"hjkl",
],
) {
word_selection::show_copy_mode_section(ui, settings, changes_this_frame, collapsed);
}
if section_matches(
&query,
"Keybindings",
&[
"shortcut",
"hotkey",
"binding",
"key",
"keyboard shortcut",
"custom",
],
) {
keybindings::show_keybindings_section(ui, settings, changes_this_frame, collapsed);
}
}
pub fn keywords() -> &'static [&'static str] {
&[
"keyboard",
"option",
"alt",
"meta",
"esc",
"physical",
"physical keys",
"remap",
"remapping",
"swap",
"ctrl",
"super",
"cmd",
"modifier",
"mouse",
"scroll",
"scroll speed",
"double-click",
"triple-click",
"click threshold",
"option+click",
"alt+click",
"focus follows",
"focus follows mouse",
"horizontal scroll",
"selection",
"clipboard",
"copy",
"paste",
"auto-copy",
"auto copy",
"trailing newline",
"middle-click",
"middle click",
"dropped file",
"quote style",
"max sync",
"max bytes",
"clipboard max",
"word characters",
"smart selection",
"keybindings",
"shortcuts",
"hotkey",
"binding",
"key",
"copy mode",
"yank",
"paste delay",
"rules",
"smart selection rules",
]
}