getNextKeyDef.d.ts 937 B

12345678910111213141516171819
  1. import { keyboardKey, keyboardOptions } from './types';
  2. /**
  3. * Get the next key from keyMap
  4. *
  5. * Keys can be referenced by `{key}` or `{special}` as well as physical locations per `[code]`.
  6. * Everything else will be interpreted as a typed character - e.g. `a`.
  7. * Brackets `{` and `[` can be escaped by doubling - e.g. `foo[[bar` translates to `foo[bar`.
  8. * Keeping the key pressed can be written as `{key>}`.
  9. * When keeping the key pressed you can choose how long (how many keydown and keypress) the key is pressed `{key>3}`.
  10. * You can then release the key per `{key>3/}` or keep it pressed and continue with the next key.
  11. * Modifiers like `{shift}` imply being kept pressed. This can be turned of per `{shift/}`.
  12. */
  13. export declare function getNextKeyDef(text: string, options: keyboardOptions): {
  14. keyDef: keyboardKey;
  15. consumedLength: number;
  16. releasePrevious: boolean;
  17. releaseSelf: boolean;
  18. repeat: number;
  19. };