Expand description
Pure winit → damascene input mappers.
Leaf translation functions with no host state — a custom
ApplicationHandler calls these from its own window_event to
produce the values damascene_core’s runtime input methods expect.
They are render-backend-neutral: the in-tree wgpu host routes every
event through these same functions, and vulkano / ash / out-of-tree
hosts use them without pulling in any GPU stack (this crate depends
on damascene-core and winit only — see issue #121).
Since the three-facet key model (#114) the mappings are total tables
over the W3C named-key and physical-code vocabularies; the tests here
assert that coverage against damascene_core’s ALL consts, so a
new core variant fails this crate’s tests instead of silently
degrading to Unidentified in every host.
Note the winit version coupling: these signatures take this crate’s
winit types, so a host must use the same winit major version
(re-check Cargo.toml on upgrades).
Functions§
- key_
modifiers - Translate winit’s
ModifiersStateto damasceneKeyModifiers. - map_key
- Translate a winit logical
Keyto a damasceneLogicalKey— the key’s layout-dependent meaning. - map_
physical - Translate a winit
PhysicalKeyto a damascenePhysicalKey— the layout-independent board position (W3Ccode). - pointer_
button - Translate a winit
MouseButtonto a damascenePointerButton. - touch_
pressure - Normalize a winit touch
Forceto the[0, 1]pressure valuePointer::with_pressureexpects.Nonein,Noneout — winit reports no force on platforms/devices without a pressure sensor. - winit_
cursor - Translate a damascene
Cursorto winit’sCursorIcon. The damascene enum is a subset of winit’s so this stays a 1:1 map; the wildcard arm is a forward-compat safety net (damascene’sCursorisnon_exhaustive— add a new variant in core, add the matching arm here, otherwise it falls back to the platform default; the test againstCursor::ALLcatches the gap).