diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-09-07 20:12:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-07 20:12:43 -0400 |
commit | 0a5e832dfddcc6184410e8836cc8dea030457486 (patch) | |
tree | e57f69567874327fe994926b97ec386e86a959ec /ext/mixed | |
parent | 59559fc56080640806f6a06d25989b9b64307300 (diff) |
Mouse inputs (#783)
* Add mouse icon
* Add _updateModifiers
* Add support for mouse button modifiers
* Improve names of mouse inputs
* Improve mouse input sorting
* Rename getModifierKeyStrings to getModifierInputStrings
* Refactor keyboard/mouse inputs into KeyboardMouseInputField
Diffstat (limited to 'ext/mixed')
-rw-r--r-- | ext/mixed/img/mouse.svg | 1 | ||||
-rw-r--r-- | ext/mixed/js/core.js | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ext/mixed/img/mouse.svg b/ext/mixed/img/mouse.svg new file mode 100644 index 00000000..80c400e6 --- /dev/null +++ b/ext/mixed/img/mouse.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M7.4883 1.0273C4.9609 1.29264 3 3.4984 3 6.1992v.30078h4.5v-5.4727c-.00385.0004-.00787-.0004-.01172 0zm1.0117 0V6.5H13v-.30078c0-2.7049-1.967-4.9121-4.5-5.1719zM3 7.5v2.3008C3 12.6816 5.23 15 8 15s5-2.3184 5-5.1992V7.5H3z" fill="#333"/></svg>
\ No newline at end of file diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js index c5c6fef2..8b044a67 100644 --- a/ext/mixed/js/core.js +++ b/ext/mixed/js/core.js @@ -341,6 +341,14 @@ class EventListenerCollection { return this._eventListeners.length; } + addGeneric(type, object, ...args) { + switch (type) { + case 'addEventListener': return this.addEventListener(object, ...args); + case 'addListener': return this.addListener(object, ...args); + case 'on': return this.on(object, ...args); + } + } + addEventListener(object, ...args) { object.addEventListener(...args); this._eventListeners.push(['removeEventListener', object, ...args]); |