amethyst / amethyst/bracket-lib

Numpad keys not working on macOS

Đang mở
#222 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
1.7k
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Thanks for this library! I've been working my way through your fantastic Hands-on Rust book, but I can't get the numpad keys to work correctly on macOS.

This is what I have found so far, using the numpad8 key as an example

On a mac the scancode for numpad8 is 91

You can see this in the winit mac platform implementation here (0x5b converted to base 10 is 91)
https://github.com/rust-windowing/winit/blob/master/src/platform_impl/macos/event.rs#L185

However, looking at the bracket-lib `virtual_key_code_to_scan` function here I see it mapping to scancode 72 (which I believe is correct for windows)
https://github.com/amethyst/bracket-lib/blob/master/bracket-terminal/src/hal/crossterm_be/scancode_helper.rs#L59

In order to get it working on a mac I think `virtual_key_code_to_scan` would need to be aware of the platform currently running and use different scancodes on a mac?

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.