Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard Input 2.0 #2662

Merged
merged 1 commit into from
May 28, 2023
Merged

Keyboard Input 2.0 #2662

merged 1 commit into from
May 28, 2023

Commits on May 28, 2023

  1. Overhaul the Keyboard API

    Overhaul the keyboard API in winit to mimic the W3C specification
    to achieve better crossplatform parity. The `KeyboardInput` event
    is now uses `KeyEvent` which consists of:
    
      - `physical_key` - a cross platform way to refer to scancodes;
      - `logical_key`  - keysym value, which shows your key respecting the
                         layout;
      - `text`         - the text produced by this keypress;
      - `location`     - the location of the key on the keyboard;
      - `repeat`       - whether the key was produced by the repeat.
    
    And also a `platform_specific` field which encapsulates extra
    information on desktop platforms, like key without modifiers
    and text with all modifiers.
    
    The `Modifiers` were also slightly reworked as in, the information
    whether the left or right modifier is pressed is now also exposed
    on platforms where it could be queried reliably. The support was
    also added for the web and orbital platforms finishing the API
    change.
    
    This change made the `OptionAsAlt` API on macOS redundant thus it
    was removed all together.
    
    Co-Authored-By: Artúr Kovács <kovacs.artur.barnabas@gmail.com>
    Co-Authored-By: Kirill Chibisov <contact@kchibisov.com>
    Co-Authored-By: daxpedda <daxpedda@gmail.com>
    Fixes: #2631.
    Fixes: #2055.
    Fixes: #2032.
    Fixes: #1904.
    Fixes: #1810.
    Fixes: #1700.
    Fixes: #1443.
    Fixes: #1343.
    Fixes: #1208.
    Fixes: #1151.
    Fixes: #812.
    Fixes: #600.
    Fixes: #361.
    Fixes: #343.
    4 people committed May 28, 2023
    Configuration menu
    Copy the full SHA
    a870147 View commit details
    Browse the repository at this point in the history