amethyst / amethyst/rustrogueliketutorial

Chapter 52: Modifier KeyCode Input Problem in Linux

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

Mô tả

Regarding Chapter 52: User Interface, the Shift+Number hotkeys are not working, in Linux (Lubuntu 20.04). In my case the keyboard layout is US. It's working exactly as expected on my Windows 10 machine. It seems the modifier key is not being recognized in Linux.

I think this is a different/separate Issue from https://github.com/amethyst/rustrogueliketutorial/issues/8. Repeating the glutin window example used by @mgedmin in https://github.com/amethyst/rustrogueliketutorial/issues/8 yields the following on my Linux machine:
```
DeviceEvent { device_id: DeviceId(X(DeviceId(12))), event: Key(KeyboardInput { scancode: 42, state: Pressed, virtual_keycode: Some(LShift), modifiers: (empty) }) }

DeviceEvent { device_id: DeviceId(X(DeviceId(12))), event: Key(KeyboardInput { scancode: 2, state: Pressed, virtual_keycode: Some(Key1), modifiers: SHIFT }) }
```

In my case the virtual keycodes are Some rather than None, but I am unsure of how to get this to work correctly in Linux.

As a workaround, I tried implementing the suggestion in issue https://github.com/amethyst/bracket-lib/issues/180, but the results of which were unsatisfactory, likely due to my implementation and poor understanding of the library. I'm not quite sure where the "game loop" section of the code should go with regards to the tutorial (I had tried putting it in the tick() function, as shown in their own source code).

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.