mirror of https://github.com/electron/electron
19 lines
554 B
HTML
19 lines
554 B
HTML
<html>
|
|
<body>
|
|
<input type="text" id="input" autofocus/>
|
|
<script type="text/javascript" charset="utf-8">
|
|
const { ipcRenderer } = require('electron')
|
|
|
|
document.onkeydown = function (e) {
|
|
ipcRenderer.send('keydown', e.key, e.code, e.keyCode, e.shiftKey, e.ctrlKey, e.altKey)
|
|
}
|
|
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)
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|