Skip to content

Commit 7e1b4b8

Browse files
committed
Extensions: Define aliases for DOM_KEY_LOCATION_*
1 parent 58b6f39 commit 7e1b4b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/scala/org/scalajs/dom/ext/Extensions.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import scala.scalajs.js.typedarray.TypedArrayBufferOps._
1111

1212
import org.scalajs.dom
1313
import org.scalajs.dom.{FormData, html, raw}
14-
import org.scalajs.dom.raw.Blob
14+
import org.scalajs.dom.raw.{Blob, KeyboardEvent}
1515

1616
/**
1717
* Used to extend out javascript *Collections to make them usable as normal
@@ -228,6 +228,14 @@ object KeyCode {
228228
// format: on
229229
}
230230

231+
/** Aliases for DOM_KEY_LOCATION_* constants from [[KeyboardEvent]] */
232+
object KeyLocation {
233+
final val Standard = KeyboardEvent.DOM_KEY_LOCATION_STANDARD
234+
final val Left = KeyboardEvent.DOM_KEY_LOCATION_LEFT
235+
final val Right = KeyboardEvent.DOM_KEY_LOCATION_RIGHT
236+
final val NumPad = KeyboardEvent.DOM_KEY_LOCATION_NUMPAD
237+
}
238+
231239
/**
232240
* Thrown when `Ajax.get` or `Ajax.post` receives a non-20X response code.
233241
* Contains the XMLHttpRequest that resulted in that response

0 commit comments

Comments
 (0)