module Graphics.UI.Threepenny.Events ( -- * Synopsis -- | Events on DOM elements. -- * Convenience events valueChange, selectionChange, checkedChange, -- * Standard DOM events click, mousemove, mousedown, mouseup, hover, leave, focus, blur, KeyCode, keyup, keydown, ) where import Graphics.UI.Threepenny.Attributes import Graphics.UI.Threepenny.Core silence = fmap (const ()) {----------------------------------------------------------------------------- Events ------------------------------------------------------------------------------} -- | Event that occurs when the /user/ changes the value of the input element. valueChange :: Element -> Event String valueChange el = unsafeMapUI el (const $ get value el) (domEvent "keydown" el) unsafeMapUI el f = unsafeMapIO (\a -> getWindow el >>= \w -> runUI w (f a)) -- | Event that occurs when the /user/ changes the selection of a @