Skip to content

Commit

Permalink
fix: macos, key conversion, skip forward delete
Browse files Browse the repository at this point in the history
Signed-off-by: fufesou <[email protected]>
  • Loading branch information
fufesou committed Dec 9, 2024
1 parent 81c3b9e commit 3678a58
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/macos/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ pub unsafe fn convert(
EventType::KeyPress(..) => {
let code =
cg_event.get_integer_value_field(EventField::KEYBOARD_EVENT_KEYCODE) as u32;
if code == kVK_Shift as _ || code == kVK_RightShift as _ {
#[allow(non_upper_case_globals)]
let skip_unicode = match code as CGKeyCode {
kVK_Shift | kVK_RightShift | kVK_ForwardDelete => true,
_ => false,
};
if skip_unicode {
None
} else {
let flags = cg_event.get_flags();
Expand Down

0 comments on commit 3678a58

Please sign in to comment.