Unify key press and mouse button press timings
Both now use Ints for presses. Still no release timer for keyboard events.
This commit is contained in:
@@ -22,13 +22,14 @@ handleTextInput text = textInput %~ (++ map Right text)
|
||||
handleKeyboardEvent :: KeyboardEventData -> Input -> Input
|
||||
handleKeyboardEvent kev = case keyboardEventKeyMotion kev of
|
||||
Released -> pressedKeys . at scode .~ Nothing
|
||||
Pressed ->
|
||||
(pressedKeys . at scode ?~ val)
|
||||
Pressed | keyboardEventRepeat kev -> addTermSignal scode
|
||||
Pressed | not (keyboardEventRepeat kev) ->
|
||||
(pressedKeys . at scode ?~ 0)
|
||||
. addTermSignal scode
|
||||
where
|
||||
val
|
||||
| keyboardEventRepeat kev = LongPress
|
||||
| otherwise = InitialPress
|
||||
-- val
|
||||
-- | keyboardEventRepeat kev = LongPress 0
|
||||
-- | otherwise = InitialPress 0
|
||||
scode = (keysymScancode . keyboardEventKeysym) kev
|
||||
|
||||
addTermSignal :: Scancode -> Input -> Input
|
||||
|
||||
Reference in New Issue
Block a user