mirror of
https://github.com/wez/wezterm.git
synced 2024-12-25 14:22:37 +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:
parent
acd016cdd4
commit
9e89a557d4
@ -416,9 +416,13 @@ pub struct Config {
|
|||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub keys: Vec<Key>,
|
pub keys: Vec<Key>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub disable_default_key_bindings: bool,
|
||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub mouse_bindings: Vec<Mouse>,
|
pub mouse_bindings: Vec<Mouse>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub disable_default_mouse_bindings: bool,
|
||||||
|
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub daemon_options: DaemonOptions,
|
pub daemon_options: DaemonOptions,
|
||||||
|
@ -143,6 +143,7 @@ impl InputMap {
|
|||||||
|
|
||||||
let ctrl_shift = KeyModifiers::CTRL | KeyModifiers::SHIFT;
|
let ctrl_shift = KeyModifiers::CTRL | KeyModifiers::SHIFT;
|
||||||
|
|
||||||
|
if !config.disable_default_key_bindings {
|
||||||
// Apply the default bindings; if the user has already mapped
|
// Apply the default bindings; if the user has already mapped
|
||||||
// a given entry then that will take precedence.
|
// a given entry then that will take precedence.
|
||||||
k!(
|
k!(
|
||||||
@ -238,7 +239,9 @@ impl InputMap {
|
|||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
k!([KeyModifiers::SUPER, KeyCode::Char('h'), HideApplication],);
|
k!([KeyModifiers::SUPER, KeyCode::Char('h'), HideApplication],);
|
||||||
|
}
|
||||||
|
|
||||||
|
if !config.disable_default_mouse_bindings {
|
||||||
m!(
|
m!(
|
||||||
[
|
[
|
||||||
KeyModifiers::NONE,
|
KeyModifiers::NONE,
|
||||||
@ -329,6 +332,7 @@ impl InputMap {
|
|||||||
Paste
|
Paste
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Self { keys, mouse }
|
Self { keys, mouse }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user