Skip to content

Commit 8119c72

Browse files
emilkkchibisov
authored andcommitted
On macOS, remove spurious error logging when handling Fn
Fixes #3246.
1 parent 43f29f0 commit 8119c72

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Unreleased` header.
1111

1212
# Unreleased
1313

14+
- On macOS, remove spurious error logging when handling `Fn`.
15+
1416
# 0.29.4
1517

1618
- Fix crash when running iOS app on macOS.

src/platform_impl/macos/event.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ pub fn get_modifierless_char(scancode: u16) -> Key {
8888
return Key::Unidentified(NativeKey::MacOS(scancode));
8989
}
9090
if result_len == 0 {
91-
log::error!("`UCKeyTranslate` was succesful but gave a string of 0 length.");
91+
// This is fine - not all keys have text representation.
92+
// For instance, users that have mapped the `Fn` key to toggle
93+
// keyboard layouts will hit this code path.
9294
return Key::Unidentified(NativeKey::MacOS(scancode));
9395
}
9496
let chars = String::from_utf16_lossy(&string[0..result_len as usize]);

0 commit comments

Comments
 (0)