slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.55k stars 601 forks source link

Add Key.Space to Key namespace #4303

Closed trobanga closed 10 months ago

trobanga commented 10 months ago

Of course Key.Space can be substituted with " ", but I think it can make the code more readable.

ogoffart commented 10 months ago

Thanks for your suggestion. I think this makes senses. The key codes are defined in https://github.com/slint-ui/slint/blob/master/internal/common/key_codes.rs

tronical commented 10 months ago

After adding it there, this code in winit could be removed: https://github.com/slint-ui/slint/blob/2efd2bc3c8d14a94dd80b12bc0eea123721fdba8/internal/backends/winit/event_loop.rs#L290