forked from ReDEnergy/SessionSync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession-hotkeys.js
More file actions
71 lines (56 loc) · 1.47 KB
/
Copy pathsession-hotkeys.js
File metadata and controls
71 lines (56 loc) · 1.47 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
define(function(require, exports) {
'use strict';
// *****************************************************************************
// Custom Modules
// Utils
const { WindowEvents } = require('../utils/global-events');
// *****************************************************************************
// API
/*
* Session Hotkeys
*/
function SessionHotkeys(document)
{
// ------------------------------------------------------------------------
// Events
var onKeyDown = function(e)
{
switch(e.keyCode)
{
// Key: F1
case 112: {
WindowEvents.emit(document, 'SessionScrollToSelected');
break;
}
// Key: F2
case 113: {
WindowEvents.emit(document, 'EditSelectedSession');
break;
}
// Key: F3
case 114: {
e.preventDefault();
WindowEvents.emit(document, 'FocusSessionFilter');
break;
}
// Key: CTRL + F
case 70: {
if (e.ctrlKey == true && e.shiftKey == false && e.altKey == false)
{
e.preventDefault();
WindowEvents.emit(document, 'FocusSessionFilter');
}
break;
}
}
};
// ------------------------------------------------------------------------
// Events
document.addEventListener('keydown', onKeyDown);
// ------------------------------------------------------------------------
// Public properties
}
// *****************************************************************************
// Public API
exports.SessionHotkeys = SessionHotkeys;
});