termi / dom-keyboard-event-level-3-polyfill Goto Github PK
View Code? Open in Web Editor NEWDOM Keyboard Event Level 3 polyfill
DOM Keyboard Event Level 3 polyfill
I was testing this on mobile safari and noticed there does not seem to be window or document level events for key listeners, for example in the demos, you must focus the input first. Almost all other browsers seems to work fine on document alone with no inputs focused.
Do you know why this is?
for example, cmd+k won't ever show the k in your demo 1 page
EDIT: this is in Chrome 26
Hi, this doesn't seem to work in Chrome (version 27.0.1453.116, Windows 7).
When entering the demo code into the Javascript console:
document.addEventListener("keydown", function(e){ console.log(e.type, e.key, e.char, e.shiftKey) })
document.dispatchEvent(new KeyboardEvent("keydown", { key: "1", char: "!", shiftKey: true }))
... the console starts outputting
keydown undefined undefined false
... as if the key and char properties are not populated.
Is this perhaps related to https://bugs.webkit.org/show_bug.cgi?id=16735 ?
Throws an error at DOMEventsLevel3.shim.js:958:
TypeError: Attempting to change writable attribute of unconfigurable property.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.