We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
I found sometimes the CGEvent.set_flags does not set flags correctly
fn set_modifier_flag(&mut self, key: &String, key_event: CGEvent, press: bool) -> CGEvent { if self.modifier_map.contains_key(key) { let event_flag: &CGEventFlags = self.modifier_map.get(key).unwrap(); if press { self.flag_holder.lock().unwrap().insert(*event_flag); key_event.set_flags(*self.flag_holder.lock().unwrap()); } else { self.flag_holder.lock().unwrap().remove(*event_flag); key_event.set_flags(*self.flag_holder.lock().unwrap()); } } // the code below is to make sure the key_event flags had been set correctly let mut repeat_setter_counter = 0; while key_event.get_flags() != *self.flag_holder.lock().unwrap() && repeat_setter_counter < 10 { key_event.set_flags(*self.flag_holder.lock().unwrap()); repeat_setter_counter += 1; std::thread::sleep(std::time::Duration::from_millis(1)); } key_event }
The text was updated successfully, but these errors were encountered:
This doesn't seem like an issue with core-graphics, CGEvent::set_flags simply calls into CGEventSetFlags.
core-graphics
CGEvent::set_flags
CGEventSetFlags
It's not entirely clear to me what your issue with it is, but perhaps submit this as feedback to Apple instead?
Sorry, something went wrong.
core-foundation-rs
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
I found sometimes the CGEvent.set_flags does not set flags correctly
The text was updated successfully, but these errors were encountered: