fix: enigo, macos, F11 (#11371)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2025-04-06 10:42:15 +08:00 committed by GitHub
parent 62a83ad319
commit 2d403913b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -142,7 +142,8 @@ impl Enigo {
}
fn post(&self, event: CGEvent) {
if !self.ignore_flags {
// event.set_flags(CGEventFlags::CGEventFlagNull); will cause `F11` not working. no idea why.
if !self.ignore_flags && self.flags != CGEventFlags::CGEventFlagNull {
event.set_flags(self.flags);
}
event.set_integer_value_field(EventField::EVENT_SOURCE_USER_DATA, ENIGO_INPUT_EXTRA_VALUE);