diff options
Diffstat (limited to 'src/server/keybindings.rs')
| -rw-r--r-- | src/server/keybindings.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server/keybindings.rs b/src/server/keybindings.rs new file mode 100644 index 00000000..262463ff --- /dev/null +++ b/src/server/keybindings.rs @@ -0,0 +1,17 @@ +use crate::app; + +pub(crate) fn app_keybindings(app: &app::App) -> crate::config::LiveKeybindConfig { + crate::config::LiveKeybindConfig { + prefix: (app.state.prefix_code, app.state.prefix_mods), + keybinds: app.state.keybinds.clone(), + } +} + +pub(crate) fn apply_keybindings( + app: &mut app::App, + keybindings: &crate::config::LiveKeybindConfig, +) { + app.state.prefix_code = keybindings.prefix.0; + app.state.prefix_mods = keybindings.prefix.1; + app.state.keybinds = keybindings.keybinds.clone(); +} |
