simple send-update-on hotkey initiation
This commit is contained in:
parent
dbad51d09a
commit
bead4a5b99
1 changed files with 16 additions and 0 deletions
16
src/modules/hotkey_handler.rs
Normal file
16
src/modules/hotkey_handler.rs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
use super::stream_states::{state_update::StateUpdate, enums::SlideChange};
|
||||||
|
|
||||||
|
pub fn create_keyboard_hooks(channel_tx: crossbeam_channel::Sender<String>) {
|
||||||
|
|
||||||
|
let tx_1 = channel_tx.clone();
|
||||||
|
inputbot::KeybdKey::PageUpKey.bind(move || {
|
||||||
|
tx_1.send(StateUpdate::ChangeSlide(SlideChange::Next).to_json().to_string()).unwrap();
|
||||||
|
});
|
||||||
|
|
||||||
|
let tx_2 = channel_tx.clone();
|
||||||
|
inputbot::KeybdKey::PageDownKey.bind(move || {
|
||||||
|
tx_2.send(StateUpdate::ChangeSlide(SlideChange::Previous).to_json().to_string()).unwrap();
|
||||||
|
});
|
||||||
|
|
||||||
|
inputbot::handle_input_events();
|
||||||
|
}
|
Loading…
Reference in a new issue