Skip to content

Send keypresses when a text input is submitted (Linux only)#36

Open
georgefst wants to merge 2 commits into
masterfrom
evdev-textinput
Open

Send keypresses when a text input is submitted (Linux only)#36
georgefst wants to merge 2 commits into
masterfrom
evdev-textinput

Conversation

@georgefst

Copy link
Copy Markdown
Owner

This needs some cleaning up.

Comment thread haskell/linux/OS.hs

type E = Map LayoutID (Device, LayoutMeta)
type S = (Device, LayoutMeta)
type S = ((Device, LayoutMeta), Text)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a record.

Comment thread haskell/linux/OS.hs
'7' -> Just Key7
'8' -> Just Key8
'9' -> Just Key9
'a' -> Just KeyA

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle capitals by inserting KeyShift?

Comment thread haskell/linux/OS.hs
ClientUpdate (SliderMove i x) ->
lookup' #sliderMap i . onAxis $ x * 2 - 1
ClientUpdate (InputText _ t) -> do
(#extra % _2) .= t

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should track each text input element separately. In fact, really the frontend should track this state anyway - see #35.

Comment thread haskell/linux/OS.hs
_ -> Nothing

keyToChar :: Key -> Maybe Char
keyToChar = \case

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY this with the above. Maybe by constructing a top level list of pairs, and two maps.

Comment thread haskell/linux/OS.hs
keyUnknown = KeyUnknown

charToKey :: Char -> Maybe Key
charToKey = \case

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably incomplete. Complete it and maybe upstream to evdev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant