Skip to content

Commit

Permalink
Merge pull request #22 from andrew-fdv/21-add-mouse-events
Browse files Browse the repository at this point in the history
Add ReactMouseEvent and ReactMouseEventI

This relates to #21
  • Loading branch information
nigredo-tori authored Mar 28, 2017
2 parents a13eb3e + e20a5f9 commit 2a2e20b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/scala/vdom/Events.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ trait Events {

type ReactEvent = SyntheticEvent[dom.Node]
type ReactKeyboardEvent = SyntheticKeyboardEvent[dom.Node]
type ReactMouseEvent = SyntheticMouseEvent[dom.Node]

type ReactEventI = SyntheticEvent[html.Input]
type ReactKeyboardEventI = SyntheticKeyboardEvent[html.Input]
type ReactMouseEventI = SyntheticMouseEvent[html.Input]

}

Expand Down Expand Up @@ -60,3 +62,22 @@ trait SyntheticKeyboardEvent[+DOMEventTarget <: dom.Node] extends SyntheticUIEve
val keyCode: Int = js.native
val which: Int = js.native
}

@js.native
trait SyntheticMouseEvent[+DOMEventTarget <: dom.Node] extends SyntheticUIEvent[DOMEventTarget] {
override val nativeEvent: dom.MouseEvent = js.native
val ctrlKey: Boolean = js.native
val shiftKey: Boolean = js.native
val altKey: Boolean = js.native
val metaKey: Boolean = js.native
val button: Short = js.native
val buttons: Short = js.native
val clientX: Double = js.native
val clientY: Double = js.native
val pageX: Double = js.native
val pageY: Double = js.native
val screenX: Double = js.native
val screenY: Double = js.native
val relatedTarget: DOMEventTarget = js.native
def getModifierState(keyArg: String): Boolean = js.native
}

0 comments on commit 2a2e20b

Please sign in to comment.