mirror of
https://github.com/robotn/gohook.git
synced 2024-11-22 02:56:54 +08:00
add capslock key support when darwin
This commit is contained in:
parent
031ea6b811
commit
caaa106d80
@ -582,15 +582,17 @@ static inline void process_modifier_changed(uint64_t timestamp, CGEventRef event
|
|||||||
process_key_released(timestamp, event_ref);
|
process_key_released(timestamp, event_ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* FIXME This should produce a modifier mask for the caps lock key!
|
|
||||||
else if (keycode == kVK_CapsLock) {
|
else if (keycode == kVK_CapsLock) {
|
||||||
|
if (current_modifiers & MASK_CAPS_LOCK) {
|
||||||
// Process as a key pressed event.
|
// Process as a key pressed event.
|
||||||
|
unset_modifier_mask(MASK_CAPS_LOCK);
|
||||||
|
process_key_released(timestamp, event_ref);
|
||||||
|
} else {
|
||||||
|
// Process as a key released event.
|
||||||
|
set_modifier_mask(MASK_CAPS_LOCK);
|
||||||
process_key_pressed(timestamp, event_ref);
|
process_key_pressed(timestamp, event_ref);
|
||||||
|
|
||||||
// Set the caps-lock flag for release.
|
|
||||||
caps_down = true;
|
|
||||||
}
|
}
|
||||||
*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These events are totally undocumented for the CGEvent type, but are required to grab media and caps-lock keys.
|
/* These events are totally undocumented for the CGEvent type, but are required to grab media and caps-lock keys.
|
||||||
|
Loading…
Reference in New Issue
Block a user