mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: sendInputEvent keyCodes being incorrectly converted Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
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>
|