-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathVK.js
More file actions
41 lines (38 loc) · 923 Bytes
/
VK.js
File metadata and controls
41 lines (38 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* VK.js
*
* Released under LGPL License.
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
*
* License: http://www.tinymce.com/license
* Contributing: http://www.tinymce.com/contributing
*/
/**
* This file exposes a set of the common KeyCodes for use. Please grow it as needed.
*/
define(
'tinymce.core.util.VK',
[
"tinymce.core.Env"
],
function (Env) {
return {
BACKSPACE: 8,
DELETE: 46,
DOWN: 40,
ENTER: 13,
LEFT: 37,
RIGHT: 39,
SPACEBAR: 32,
TAB: 9,
UP: 38,
modifierPressed: function (e) {
return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e);
},
metaKeyPressed: function (e) {
// Check if ctrl or meta key is pressed. Edge case for AltGr on Windows where it produces ctrlKey+altKey states
return (Env.mac ? e.metaKey : e.ctrlKey && !e.altKey);
}
};
}
);