VK.js 745 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * VK.js
  3. *
  4. * Copyright, Moxiecode Systems AB
  5. * Released under LGPL License.
  6. *
  7. * License: http://www.tinymce.com/license
  8. * Contributing: http://www.tinymce.com/contributing
  9. */
  10. /**
  11. * This file exposes a set of the common KeyCodes for use. Please grow it as needed.
  12. */
  13. define("tinymce/util/VK", [
  14. "tinymce/Env"
  15. ], function(Env) {
  16. return {
  17. BACKSPACE: 8,
  18. DELETE: 46,
  19. DOWN: 40,
  20. ENTER: 13,
  21. LEFT: 37,
  22. RIGHT: 39,
  23. SPACEBAR: 32,
  24. TAB: 9,
  25. UP: 38,
  26. modifierPressed: function(e) {
  27. return e.shiftKey || e.ctrlKey || e.altKey;
  28. },
  29. metaKeyPressed: function(e) {
  30. // Check if ctrl or meta key is pressed also check if alt is false for Polish users
  31. return (Env.mac ? e.metaKey : e.ctrlKey) && !e.altKey;
  32. }
  33. };
  34. });