Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/delay #137

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions wooting-macro-backend/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use env_logger::Env;
use wooting_macro_backend::MacroBackend;
use log::*;
use wooting_macro_backend::MacroBackend;

#[tokio::main(flavor = "multi_thread", worker_threads = 10)]
/// This main function serves only for running the backend. Backend can be run without frontend parts as most things are separated.
async fn main() {

env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();


info!("Running only backend");

let backend = MacroBackend::default();
Expand Down
7 changes: 1 addition & 6 deletions wooting-macro-backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,9 @@ async fn execute_macro(macros: Macro, channel: UnboundedSender<rdev::EventType>)
fn keypress_executor_sender(mut rchan_execute: UnboundedReceiver<rdev::EventType>) {
loop {
plugin::util::send(&rchan_execute.blocking_recv().unwrap());

//Windows requires a delay between each macro execution.
//MacOS and Linux require a delay between each macro execution.
#[cfg(any(target_os = "macos", target_os = "linux"))]
thread::sleep(time::Duration::from_millis(10));

//MacOS requires some strange delays so putting it here just in case.
#[cfg(target_os = "windows")]
thread::sleep(time::Duration::from_millis(1));
}
}

Expand Down