Fix handling key events (this also intercepts browser shortcuts, sadly)
This commit is contained in:
parent
7dd55d94a9
commit
abf45f3dcb
2 changed files with 1 additions and 5 deletions
|
|
@ -22,10 +22,6 @@ namespace psemek::sdl2
|
||||||
|
|
||||||
window::window(psemek::app::application::options const & options)
|
window::window(psemek::app::application::options const & options)
|
||||||
{
|
{
|
||||||
#ifdef __EMSCRIPTEN__
|
|
||||||
SDL_SetHint(SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT, "#canvas");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
sdl_init_ = init(SDL_INIT_EVENTS | SDL_INIT_VIDEO);
|
sdl_init_ = init(SDL_INIT_EVENTS | SDL_INIT_VIDEO);
|
||||||
|
|
||||||
std::uint32_t flags = SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE;
|
std::uint32_t flags = SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
|
<canvas id="canvas" tabindex="-1" oncontextmenu="event.preventDefault()"></canvas>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var Module = {
|
var Module = {
|
||||||
canvas: document.getElementById('canvas'),
|
canvas: document.getElementById('canvas'),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue