mirror of
https://github.com/robotn/gohook.git
synced 2024-11-25 05:46:52 +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) {
|
||||||
// Process as a key pressed event.
|
if (current_modifiers & MASK_CAPS_LOCK) {
|
||||||
process_key_pressed(timestamp, event_ref);
|
// Process as a key pressed event.
|
||||||
|
unset_modifier_mask(MASK_CAPS_LOCK);
|
||||||
// Set the caps-lock flag for release.
|
process_key_released(timestamp, event_ref);
|
||||||
caps_down = true;
|
} else {
|
||||||
|
// Process as a key released event.
|
||||||
|
set_modifier_mask(MASK_CAPS_LOCK);
|
||||||
|
process_key_pressed(timestamp, event_ref);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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