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.

action.js 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. module.exports = (key, isSelect) => {
  3. if (key.meta && key.name !== 'escape') return;
  4. if (key.ctrl) {
  5. if (key.name === 'a') return 'first';
  6. if (key.name === 'c') return 'abort';
  7. if (key.name === 'd') return 'abort';
  8. if (key.name === 'e') return 'last';
  9. if (key.name === 'g') return 'reset';
  10. }
  11. if (isSelect) {
  12. if (key.name === 'j') return 'down';
  13. if (key.name === 'k') return 'up';
  14. }
  15. if (key.name === 'return') return 'submit';
  16. if (key.name === 'enter') return 'submit'; // ctrl + J
  17. if (key.name === 'backspace') return 'delete';
  18. if (key.name === 'delete') return 'deleteForward';
  19. if (key.name === 'abort') return 'abort';
  20. if (key.name === 'escape') return 'exit';
  21. if (key.name === 'tab') return 'next';
  22. if (key.name === 'pagedown') return 'nextPage';
  23. if (key.name === 'pageup') return 'prevPage'; // TODO create home() in prompt types (e.g. TextPrompt)
  24. if (key.name === 'home') return 'home'; // TODO create end() in prompt types (e.g. TextPrompt)
  25. if (key.name === 'end') return 'end';
  26. if (key.name === 'up') return 'up';
  27. if (key.name === 'down') return 'down';
  28. if (key.name === 'right') return 'right';
  29. if (key.name === 'left') return 'left';
  30. return false;
  31. };