javascript - Is it possible to fetch / query the pressed keys on keyboard without events? -
i wanted know if events required pressed keys (or mouse buttons extension) javascript.
is there way fetch or query keys without events, , able them simple loop (for example).
the act of pressing key fires event, regardless of whether or not have event handler event configured.
as whether or not need event handler detect key press - believe answer yes do.
however, simulate functionality requesting global object variable, , event handler each keydown
, keyup
stores pressed key , removes released key in aforementioned variable. loop can take @ global variable.
Comments
Post a Comment