fix test
This commit is contained in:
parent
974376d404
commit
08f6c1ad5e
4 changed files with 29 additions and 2 deletions
|
|
@ -649,7 +649,7 @@ export const always = register('always', function (func, pat) {
|
|||
* @memberof Pattern
|
||||
* @returns Pattern
|
||||
* @example
|
||||
* * s("bd(5,8)").onKey("Control:j", x => x.segment(16).color("red")).onKey("Control:i", x => x.fast(2).color("blue"))
|
||||
* s("bd(5,8)").onKey("Control:j", x => x.segment(16).color("red")).onKey("Control:i", x => x.fast(2).color("blue"))
|
||||
*/
|
||||
|
||||
export const onKey = register('onKey', function (input, func, pat) {
|
||||
|
|
|
|||
|
|
@ -438,6 +438,9 @@ let keyState;
|
|||
|
||||
export function getCurrentKeyboardState() {
|
||||
if (keyState == null) {
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
keyState = {};
|
||||
// Listen for the keydown event to mark the key as pressed
|
||||
window.addEventListener('keydown', (event) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue