Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Cmd.PhysicalKey

Contents

Description

Handle physical_key layout.

Synopsis

key layout

physical_key :: CallStack.Stack => Char -> Char Source #

Map a physical key, written relative to USA qwerty layout, to whatever character that key actually emits (if the layout is already USA qwerty then it's id of course). This is for layouts which should be done based on physical key position, like piano-style keyboards. It makes the overlapping-ness of non-mapped keys hard to predict though.

Since it's intended to map literal key characters, there is no accomodation for failure. Really this should be done at compile time, so it's conceptually a compile time error.

TODO isn't there some way I can get this at compile time? template haskell?

pitch_map :: Map Char Pitch.Pitch Source #

Map logical keys to the pitches they emit when kbd entry is on. It's in this module so it can be shared with instruments that also want to take over those keys. I intentionally omit some keys so their editing functions still work in kbd entry.