summaryrefslogtreecommitdiff
path: root/alarm/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js
diff options
context:
space:
mode:
Diffstat (limited to 'alarm/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js')
-rw-r--r--alarm/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/alarm/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js b/alarm/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js
new file mode 100644
index 0000000..e711f4d
--- /dev/null
+++ b/alarm/node_modules/jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js
@@ -0,0 +1,29 @@
+"use strict";
+
+const { mixin } = require("../../utils");
+const EventModifierMixinImpl = require("./EventModifierMixin-impl").implementation;
+const UIEventImpl = require("./UIEvent-impl").implementation;
+
+const KeyboardEventInit = require("../generated/KeyboardEventInit");
+
+class KeyboardEventImpl extends UIEventImpl {
+ initKeyboardEvent(type, bubbles, cancelable, view, key, location, ctrlKey, altKey, shiftKey, metaKey) {
+ if (this._dispatchFlag) {
+ return;
+ }
+
+ this.initUIEvent(type, bubbles, cancelable, view, 0);
+ this.key = key;
+ this.location = location;
+ this.ctrlKey = ctrlKey;
+ this.altKey = altKey;
+ this.shiftKey = shiftKey;
+ this.metaKey = metaKey;
+ }
+}
+mixin(KeyboardEventImpl.prototype, EventModifierMixinImpl.prototype);
+KeyboardEventImpl.defaultInit = KeyboardEventInit.convert(undefined);
+
+module.exports = {
+ implementation: KeyboardEventImpl
+};