added feature flag to disable hotkey-hooking

This commit is contained in:
Nickiel12 2022-06-29 18:00:30 -07:00
parent 625014bcfd
commit 014adade68

View file

@ -17,6 +17,7 @@ pub const OPTIONS_PATH: &str = "./options.json";
pub const OPTIONS_PATH: &str = "./options.json"; pub const OPTIONS_PATH: &str = "./options.json";
*/ */
#[cfg(feature = "with_hotkeys")]
pub fn create_keyboard_hooks(channel_tx: crossbeam_channel::Sender<String>, close_flag: workctl::sync_flag::SyncFlagRx) { pub fn create_keyboard_hooks(channel_tx: crossbeam_channel::Sender<String>, close_flag: workctl::sync_flag::SyncFlagRx) {
let tx_1 = channel_tx.clone(); let tx_1 = channel_tx.clone();
@ -32,6 +33,11 @@ pub fn create_keyboard_hooks(channel_tx: crossbeam_channel::Sender<String>, clos
inputbot::handle_input_events(close_flag); inputbot::handle_input_events(close_flag);
} }
#[cfg(feature = "no_hotkeys")]
pub fn create_keyboard_hooks(channel_tx: crossbeam_channel::Sender<String>, close_flag: workctl::sync_flag::SyncFlagRx) {
return
}
pub struct Hotkeys { pub struct Hotkeys {
pub hotkeys: serde_json::Value, pub hotkeys: serde_json::Value,
} }