mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-10 21:28:31 +00:00
add keyDown
This commit is contained in:
parent
2443aad01b
commit
3d162536aa
@ -138,6 +138,18 @@ pnpm --filter "./packages/**" publish --access public
|
|||||||
To manually publish a single package, increase the version in the `package.json`, then run `pnpm publish`.
|
To manually publish a single package, increase the version in the `package.json`, then run `pnpm publish`.
|
||||||
Important: Always publish with `pnpm`, as `npm` does not support overriding main files in `publishConfig`, which is done in all the packages.
|
Important: Always publish with `pnpm`, as `npm` does not support overriding main files in `publishConfig`, which is done in all the packages.
|
||||||
|
|
||||||
|
|
||||||
|
## useful commands
|
||||||
|
```sh
|
||||||
|
#regenerate the test snapshots (ex: when updating or creating new pattern functions)
|
||||||
|
pnpm snapshot
|
||||||
|
|
||||||
|
#start the OSC server
|
||||||
|
pnpm run osc
|
||||||
|
|
||||||
|
#build the standalone version
|
||||||
|
pnpm tauri build
|
||||||
|
```
|
||||||
## Have Fun
|
## Have Fun
|
||||||
|
|
||||||
Remember to have fun, and that this project is driven by the passion of volunteers!
|
Remember to have fun, and that this project is driven by the passion of volunteers!
|
||||||
|
|||||||
@ -644,7 +644,7 @@ export const always = register('always', function (func, pat) {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Do something on a keypress, or array of keypresses
|
* Do something on a keypress, or array of keypresses
|
||||||
* key name reference: https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
* * {@link https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values|Key name reference}
|
||||||
*
|
*
|
||||||
* @name whenKey
|
* @name whenKey
|
||||||
* @memberof Pattern
|
* @memberof Pattern
|
||||||
@ -654,5 +654,21 @@ export const always = register('always', function (func, pat) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const whenKey = register('whenKey', function (input, func, pat) {
|
export const whenKey = register('whenKey', function (input, func, pat) {
|
||||||
return pat.when(isKeyDown(input), func);
|
return pat.when(keyDown(input), func);
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* returns true when a key or array of keys is held
|
||||||
|
* {@link https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values|Key name reference}
|
||||||
|
*
|
||||||
|
* @name keyDown
|
||||||
|
* @memberof Pattern
|
||||||
|
* @returns Pattern
|
||||||
|
* @example
|
||||||
|
* keyDown("Control:j").pick([s("bd(5,8)"), s("cp(3,8)")])
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const keyDown = register('keyDown', function (pat) {
|
||||||
|
return pat.fmap(isKeyDown);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4065,6 +4065,8 @@ exports[`runs examples > example "juxBy" example index 0 1`] = `
|
|||||||
]
|
]
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`runs examples > example "keyDown" example index 0 1`] = `[]`;
|
||||||
|
|
||||||
exports[`runs examples > example "lastOf" example index 0 1`] = `
|
exports[`runs examples > example "lastOf" example index 0 1`] = `
|
||||||
[
|
[
|
||||||
"[ 0/1 → 1/4 | note:c3 ]",
|
"[ 0/1 → 1/4 | note:c3 ]",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user