equal
deleted
inserted
replaced
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 /** |
|
12 * This file exposes a set of the common KeyCodes for use. Please grow it as needed. |
|
13 */ |
|
14 define("tinymce/util/VK", [ |
|
15 "tinymce/Env" |
|
16 ], function(Env) { |
|
17 return { |
|
18 BACKSPACE: 8, |
|
19 DELETE: 46, |
|
20 DOWN: 40, |
|
21 ENTER: 13, |
|
22 LEFT: 37, |
|
23 RIGHT: 39, |
|
24 SPACEBAR: 32, |
|
25 TAB: 9, |
|
26 UP: 38, |
|
27 |
|
28 modifierPressed: function(e) { |
|
29 return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e); |
|
30 }, |
|
31 |
|
32 metaKeyPressed: function(e) { |
|
33 // Check if ctrl or meta key is pressed. Edge case for AltGr on Windows where it produces ctrlKey+altKey states |
|
34 return (Env.mac ? e.metaKey : e.ctrlKey && !e.altKey); |
|
35 } |
|
36 }; |
|
37 }); |
|