1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-24 22:01:47 +03:00

wezterm: add disable_default_(key|mouse)_bindings config

If set to true, then none of the default key or mouse bindings,
respectively, will be registered in the GUI, leaving it up to
the user to provide all key assignments.
This commit is contained in:
Wez Furlong 2020-05-28 22:22:02 -07:00
parent acd016cdd4
commit 9e89a557d4
2 changed files with 192 additions and 184 deletions

View File

@ -416,9 +416,13 @@ pub struct Config {
#[serde(default)]
pub keys: Vec<Key>,
#[serde(default)]
pub disable_default_key_bindings: bool,
#[serde(default)]
pub mouse_bindings: Vec<Mouse>,
#[serde(default)]
pub disable_default_mouse_bindings: bool,
#[serde(default)]
pub daemon_options: DaemonOptions,

View File

@ -143,6 +143,7 @@ impl InputMap {
let ctrl_shift = KeyModifiers::CTRL | KeyModifiers::SHIFT;
if !config.disable_default_key_bindings {
// Apply the default bindings; if the user has already mapped
// a given entry then that will take precedence.
k!(
@ -238,7 +239,9 @@ impl InputMap {
#[cfg(target_os = "macos")]
k!([KeyModifiers::SUPER, KeyCode::Char('h'), HideApplication],);
}
if !config.disable_default_mouse_bindings {
m!(
[
KeyModifiers::NONE,
@ -329,6 +332,7 @@ impl InputMap {
Paste
],
);
}
Self { keys, mouse }
}