Skip to content

Commit

Permalink
Merge pull request #395 from chrislatorres/master
Browse files Browse the repository at this point in the history
Add fullscreen keybinding
  • Loading branch information
avaer committed Aug 30, 2018
2 parents a7638a0 + 2359b64 commit 99faba4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Expand Up @@ -586,6 +586,16 @@ nativeWindow.setEventHandler((type, data) => {
handled = true;
}
}
//122 is F11 key
if (data.keyCode === 122){
if (window.top.document.fullscreenElement) {
window.top.document.exitFullscreen();
handled = true;
} else {
window.top.document.requestFullscreen();
handled = true;
}
}

if (!handled) {
canvas.dispatchEvent(new window.KeyboardEvent(type, data));
Expand Down

0 comments on commit 99faba4

Please sign in to comment.