add capslock key support when darwin

This commit is contained in:
vcaesar 2020-02-24 11:49:40 -04:00
parent 031ea6b811
commit caaa106d80

View File

@ -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.