Skip to content

Commit

Permalink
On macOS, remove spurious error logging when handling Fn
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk authored and kchibisov committed Dec 21, 2023
1 parent 43f29f0 commit bc99467
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Unreleased` header.

# Unreleased

- On macOS, remove spurious error logging when handling `Fn`.

# 0.29.4

- Fix crash when running iOS app on macOS.
Expand Down
4 changes: 3 additions & 1 deletion src/platform_impl/macos/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ pub fn get_modifierless_char(scancode: u16) -> Key {
return Key::Unidentified(NativeKey::MacOS(scancode));
}
if result_len == 0 {
log::error!("`UCKeyTranslate` was succesful but gave a string of 0 length.");
// This is fine - not all keys have text representation.
// For instance, users that have mapped the `Fn` key to toggle
// keyboard layouts will hit this code path.
return Key::Unidentified(NativeKey::MacOS(scancode));
}
let chars = String::from_utf16_lossy(&string[0..result_len as usize]);
Expand Down

0 comments on commit bc99467

Please sign in to comment.