amethyst / amethyst/bracket-lib

Numpad keys not working on macOS

未关闭
#222 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
1.7k
派生
126
PR 合并指标
30 天内没有已合并 PR

描述

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?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。