Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const utils_1 = require("../../utils");
  4. function keys(value) {
  5. let keySequence = [];
  6. if (typeof value === 'string') {
  7. keySequence = utils_1.checkUnicode(value, this.isDevTools);
  8. }
  9. else if (Array.isArray(value)) {
  10. const charArray = value;
  11. for (const charSet of charArray) {
  12. keySequence = keySequence.concat(utils_1.checkUnicode(charSet, this.isDevTools));
  13. }
  14. }
  15. else {
  16. throw new Error('"keys" command requires a string or array of strings as parameter');
  17. }
  18. if (!this.isW3C) {
  19. return this.sendKeys(keySequence);
  20. }
  21. const keyDownActions = keySequence.map((value) => ({ type: 'keyDown', value }));
  22. const keyUpActions = keySequence.map((value) => ({ type: 'keyUp', value }));
  23. return this.performActions([{
  24. type: 'key',
  25. id: 'keyboard',
  26. actions: [...keyDownActions, ...keyUpActions]
  27. }]).then(() => this.releaseActions());
  28. }
  29. exports.default = keys;