a-game

2D platformer written from scratch.
git clone git://git.amin.space/a-game.git
Log | Files | Refs | README | LICENSE

commit 300221b1551048b29b92b78fee9da849dc64c71c
parent 45d442fea9b43b5915264741259f95482c903d7a
Author: amin <dev@aminmesbah.com>
Date:   Sun,  7 Jul 2019 02:43:05 +0000

Block browser full screen on wasm F11 keydown

FossilOrigin-Name: 0337e867e2d184eafc90f368648261874a7df1da23a842fcb48ae77901a1eeae
Diffstat:
Msrc/platform_wasm_loader.js | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/platform_wasm_loader.js b/src/platform_wasm_loader.js @@ -261,6 +261,10 @@ function file_load(name) { function on_key_event(e, key_is_down) { let sane_numeric_code = key_numeric_codes[e.code]; if (sane_numeric_code !== undefined) { + if (sane_numeric_code === 5) { + // Don't toggle full screen + e.preventDefault(); + } exports['key_callback'](sane_numeric_code, key_is_down); } }