electron/docs/fiddles/features/keyboard-shortcuts/web-apis/renderer.js
Tony Ferrell 77e7d828ee
docs: Update docs for keyboard shortcuts (#29207)
* Update docs for keyboard shortcuts

* Add a fiddle for web-apis

* Apply suggestions from code review

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* Cleanup a few formatting errors and missed copies

* Add descriptions to index.html

* Focus on renderer

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-24 11:33:22 +09:00

7 lines
250 B
JavaScript

function handleKeyPress (event) {
// You can put code here to handle the keypress.
document.getElementById("last-keypress").innerText = event.key
console.log(`You pressed ${event.key}`)
}
window.addEventListener('keyup', handleKeyPress, true)