Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.81 KB

changelog.md

File metadata and controls

49 lines (35 loc) · 1.81 KB

Changelog

This changelog is written with the goal of helping you through breaking changes rather than being a complete documentation of every change in the release.

0.16

0.15

Upgraded to winit 0.29. Winit 0.29 completely overhauled its keyboard API, which meant that I had to also overhaul our keyboard API.

Previously winit_input_helper favored logical keys over physical keys (previously called scancodes). But this was a mistake, driven by winit's poor support for physical keys and mistaken simplification of logical keys. Winit has now fixed these mistakes and as a result winit_input_helper is now swapping to favor physical keys.

A direct translation of the previous API to the new API:

// old
input.key_pressed_scancode(17); // US scan code for W
// new
input.key_presed(winit::keyboard::KeyCode::KeyW);

// old
input.key_pressed(winit::event::VirtualKeyCode::KeyW);
// new
input.key_presed_logical(winit::keyboard::Key::Character("w")); // WARNING: this likely wont actually do what you want, this will never return true while shift is held since that is considered as `W` instead of `w`

// ... other keyboard methods follow the same pattern

However, I actually suggest you move to physical keys:

// old
input.key_pressed_scancode(17); // US scan code for W
// new
input.key_presed(winit::keyboard::KeyCode::KeyW);

// old
input.key_pressed(winit::event::VirtualKeyCode::W);
// new
input.key_presed(winit::keyboard::KeyCode::KeyW);