Skip to content

Add KeyboardEvent#code #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions api-reports/2_12.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
scala-js-dom API
================

This is generated automatically on compile via custom Scalafix rule 'GenerateApiReport'.

Flags:
[J-] = JavaScript type
[S-] = Scala type
[-C] = Class
[-T] = Trait
[-O] = Object


scala-js-dom API
================
This is generated automatically on compile via custom Scalafix rule 'GenerateApiReport'.
Flags:
[J-] = JavaScript type
[S-] = Scala type
[-C] = Class
[-T] = Trait
[-O] = Object
AbortController[JC] def abort(): Unit
AbortController[JC] val signal: AbortSignal
AbortSignal[JT] def aborted: Boolean
Expand Down Expand Up @@ -15347,6 +15347,7 @@ KeyboardEvent[JC] def bubbles: Boolean
KeyboardEvent[JC] def cancelBubble: Boolean
KeyboardEvent[JC] def cancelable: Boolean
KeyboardEvent[JC] def charCode: Int
KeyboardEvent[JC] def code: String
KeyboardEvent[JC] def ctrlKey: Boolean
KeyboardEvent[JC] def currentTarget: EventTarget
KeyboardEvent[JC] def defaultPrevented: Boolean
Expand Down Expand Up @@ -15375,6 +15376,7 @@ KeyboardEventInit[JT] var altKey: js.UndefOr[Boolean]
KeyboardEventInit[JT] var bubbles: js.UndefOr[Boolean]
KeyboardEventInit[JT] var cancelable: js.UndefOr[Boolean]
KeyboardEventInit[JT] var charCode: js.UndefOr[Int]
KeyboardEventInit[JT] var code: js.UndefOr[String]
KeyboardEventInit[JT] var composed: js.UndefOr[Boolean]
KeyboardEventInit[JT] var ctrlKey: js.UndefOr[Boolean]
KeyboardEventInit[JT] var detail: js.UndefOr[Int]
Expand All @@ -15401,7 +15403,7 @@ Location[JT] def reload(flag: Boolean?): Unit
Location[JT] def replace(url: String): Unit
Location[JT] var search: String
MIMEType[JT]
MIMEType[SO] val `application/xhtml+xml` = "application/xhtml+xml".asInstanceOf[MIMEType]
MIMEType[SO] val `application/xhtml+xml` = "application/xhtml+xml".asInstanceOf[MIMEType]
MIMEType[SO] val `application/xml` = "application/xml".asInstanceOf[MIMEType]
MIMEType[SO] val `image/svg+xml` = "image/svg+xml".asInstanceOf[MIMEType]
MIMEType[SO] val `text/html` = "text/html".asInstanceOf[MIMEType]
Expand Down Expand Up @@ -16116,7 +16118,7 @@ PermissionName[JT]
PermissionName[SO] val geolocation: PermissionName
PermissionName[SO] val midi: PermissionName
PermissionName[SO] val notifications: PermissionName
PermissionName[SO] val `persistent-storage` = "persistent-storage".asInstanceOf[PermissionName]
PermissionName[SO] val `persistent-storage` = "persistent-storage".asInstanceOf[PermissionName]
PermissionName[SO] val push: PermissionName
PermissionState[JT]
PermissionState[SO] val denied: PermissionState
Expand Down Expand Up @@ -16502,9 +16504,9 @@ RTCSessionDescriptionInit[SO] def apply(`type`: js.UndefOr[RTCSdpType]?, sdp: js
RTCSignalingState[JT]
RTCSignalingState[SO] val closed: RTCSignalingState
RTCSignalingState[SO] val `have-local-offer` = "have-local-offer".asInstanceOf[RTCSignalingState]
RTCSignalingState[SO] val `have-local-pranswer` = "have-local-pranswer".asInstanceOf[RTCSignalingState]
RTCSignalingState[SO] val `have-local-pranswer` = "have-local-pranswer".asInstanceOf[RTCSignalingState]
RTCSignalingState[SO] val `have-remote-offer` = "have-remote-offer".asInstanceOf[RTCSignalingState]
RTCSignalingState[SO] val `have-remote-pranswer` = "have-remote-pranswer".asInstanceOf[RTCSignalingState]
RTCSignalingState[SO] val `have-remote-pranswer` = "have-remote-pranswer".asInstanceOf[RTCSignalingState]
RTCSignalingState[SO] val stable: RTCSignalingState
RTCStats[JT] val id: String
RTCStats[JT] val timestamp: Double
Expand Down Expand Up @@ -16574,9 +16576,9 @@ ReadableStreamUnderlyingSource[JT] var `type`: js.UndefOr[ReadableStreamType]
ReferrerPolicy[JT]
ReferrerPolicy[SO] val empty: ReferrerPolicy
ReferrerPolicy[SO] val `no-referrer` = "no-referrer".asInstanceOf[ReferrerPolicy]
ReferrerPolicy[SO] val `no-referrer-when-downgrade` = "no-referrer-when-downgrade".asInstanceOf[ReferrerPolicy]
ReferrerPolicy[SO] val `no-referrer-when-downgrade` = "no-referrer-when-downgrade".asInstanceOf[ReferrerPolicy]
ReferrerPolicy[SO] val `origin-only` = "origin-only".asInstanceOf[ReferrerPolicy]
ReferrerPolicy[SO] val `origin-when-cross-origin` = "origin-when-cross-origin".asInstanceOf[ReferrerPolicy]
ReferrerPolicy[SO] val `origin-when-cross-origin` = "origin-when-cross-origin".asInstanceOf[ReferrerPolicy]
ReferrerPolicy[SO] val `unsafe-url` = "unsafe-url".asInstanceOf[ReferrerPolicy]
Request[JC] def arrayBuffer(): js.Promise[ArrayBuffer]
Request[JC] def blob(): js.Promise[Blob]
Expand Down Expand Up @@ -27555,4 +27557,4 @@ webworkers[SO] type WorkerGlobalScope = dom.WorkerGlobalScope (@deprecated in 2
webworkers[SO] type WorkerLocation = dom.WorkerLocation (@deprecated in 2.0.0)
webworkers[SO] type WorkerNavigator = dom.WorkerNavigator (@deprecated in 2.0.0)
webworkers[SO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0)
webworkers.DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0)
webworkers.DedicatedWorkerGlobalScope[JO] def self: DedicatedWorkerGlobalScope (@deprecated in 2.0.0)
Expand Down
3 changes: 3 additions & 0 deletions dom/src/main/scala/org/scalajs/dom/KeyboardEvent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class KeyboardEvent(typeArg: String, init: js.UndefOr[KeyboardEventInit])

/** Returns the current state of the specified modifier key. */
def getModifierState(keyArg: String): Boolean = js.native

/** Returns a string with the code value of the physical key represented by the event. */
def code: String = js.native
}

@js.native
Expand Down
3 changes: 3 additions & 0 deletions dom/src/main/scala/org/scalajs/dom/KeyboardEventInit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ trait KeyboardEventInit extends UIEventInit with ModifierKeyEventInit {

/** Sets value of KeyboardEvent.repeat. Defaults to false. */
var repeat: js.UndefOr[Boolean] = js.undefined

/** Sets value of KeyboardEvent.code. Defaults to empty string. */
var code: js.UndefOr[String] = js.undefined;
}