electron/spec/fixtures/pages/key-events.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
554 B
HTML
Raw Normal View History

2016-10-07 21:44:35 +00:00
<html>
<body>
<input type="text" id="input" autofocus/>
2016-10-07 21:44:35 +00:00
<script type="text/javascript" charset="utf-8">
const { ipcRenderer } = require('electron')
2016-10-07 21:44:35 +00:00
document.onkeydown = function (e) {
ipcRenderer.send('keydown', e.key, e.code, e.keyCode, e.shiftKey, e.ctrlKey, e.altKey)
2016-10-07 21:44:35 +00:00
}
2016-10-07 22:12:35 +00:00
document.onkeypress = function (e) {
ipcRenderer.send('keypress', e.key, e.code, e.keyCode, e.shiftKey, e.ctrlKey, e.altKey)
}
document.onkeyup = function (e) {
ipcRenderer.send('keyup', e.key, e.code, e.keyCode, e.shiftKey, e.ctrlKey, e.altKey)
2016-10-07 22:12:35 +00:00
}
2016-10-07 21:44:35 +00:00
</script>
</body>
</html>