on develop help sign in
Add Keydown and Keyup events
commitb8372b875ff89e32d788739cc9833671fdb5cf53 authorRyan Trinkle <ryan.trinkle@gmail.com> dateTue 15 Sep 2015, 11:09 (11 years ago) parent097d8e8
1 file changed+4
src/Reflex/Dom/Widget/Basic.hs+4
src/Reflex/Dom/Widget/Basic.hs+4
@@ -523,6 +523,8 @@ type family EventResultType (en :: EventTag) :: * where
523523 EventResultType 'ClickTag = ()
524524 EventResultType 'DblclickTag = ()
525525 EventResultType 'KeypressTag = Int
526+ EventResultType 'KeydownTag = Int
527+ EventResultType 'KeyupTag = Int
526528 EventResultType 'ScrollTag = Int
527529 EventResultType 'MousemoveTag = (Int, Int)
528530 EventResultType 'MousedownTag = (Int, Int)
@@ -572,6 +574,8 @@ defaultDomEventHandler e evt = liftM (Just . EventResult) $ case evt of
572574 Click -> return ()
573575 Dblclick -> return ()
574576 Keypress -> getKeyEvent
577+ Keydown -> getKeyEvent
578+ Keyup -> getKeyEvent
575579 Scroll -> liftIO $ elementGetScrollTop e
576580 Mousemove -> getMouseEventCoords
577581 Mouseup -> getMouseEventCoords