// pressed.
ui::KeyboardCode KeyboardCodeFromStr(const std::string& str, bool* shifted);
+// Ported from ui/events/blink/blink_event_util.h
int WebEventModifiersToEventFlags(int modifiers);
} // namespace atom
<body>
<script type="text/javascript" charset="utf-8">
document.onkeyup = function(e) {
- require('electron').ipcRenderer.sendToHost('keyup', e.keyCode, e.shiftKey, e.ctrlKey);
+ require('electron').ipcRenderer.sendToHost('keyup', e.key, e.code, e.keyCode, e.shiftKey, e.ctrlKey);
}
</script>
</body>
it('can send keyboard event', function (done) {
webview.addEventListener('ipc-message', function (e) {
assert.equal(e.channel, 'keyup')
- assert.deepEqual(e.args, [67, true, false])
+ assert.deepEqual(e.args, ['C', 'KeyC', 67, true, false])
done()
})
webview.addEventListener('dom-ready', function () {