2012-08-10 18:31:32 +04:00
|
|
|
/*********************************************************************/
|
2012-08-10 20:44:48 +04:00
|
|
|
// NOTE: use String.fromCharCode(code)...
|
2012-08-28 02:45:32 +04:00
|
|
|
// list of keys to be ignored by handler but still handled by the browser...
|
2012-08-25 01:58:27 +04:00
|
|
|
var ignorekeys = [
|
|
|
|
|
116, // F5
|
|
|
|
|
123, // F12
|
|
|
|
|
]
|
2012-08-28 02:45:32 +04:00
|
|
|
|
|
|
|
|
|
2012-08-08 23:19:40 +04:00
|
|
|
var keybindings = {
|
2012-08-14 22:28:33 +04:00
|
|
|
// togglable modes and options...
|
2012-08-20 02:12:33 +04:00
|
|
|
191: {
|
|
|
|
|
'default': ImageGrid.showKeyboardBindings, // ?
|
|
|
|
|
'ctrl': ImageGrid.showSetup, // ctrl+?
|
|
|
|
|
},
|
2012-08-22 23:37:09 +04:00
|
|
|
80: ImageGrid.showSetup, // p
|
2012-08-14 23:40:26 +04:00
|
|
|
70: ImageGrid.toggleSingleImageMode, // f
|
2012-08-08 23:19:40 +04:00
|
|
|
13: 70, // Enter
|
2012-08-22 02:00:23 +04:00
|
|
|
83: ImageGrid.toggleSingleRibbonMode, // s
|
2012-08-15 04:03:11 +04:00
|
|
|
84: ImageGrid.toggleSingleImageModeTransitions, // t
|
|
|
|
|
65: ImageGrid.toggleTransitions, // a
|
|
|
|
|
9: ImageGrid.toggleControls, // tab
|
2012-08-19 20:32:37 +04:00
|
|
|
66: ImageGrid.toggleBackgroundModes, // b
|
2012-08-22 19:39:20 +04:00
|
|
|
73: ImageGrid.toggleCurrentRibbonOpacity, // i
|
2012-08-08 23:19:40 +04:00
|
|
|
77: toggleMarkers, // m
|
|
|
|
|
|
2012-08-29 19:14:57 +04:00
|
|
|
87: ImageGrid.saveState, // w
|
2012-08-14 22:28:33 +04:00
|
|
|
|
2012-08-19 20:32:37 +04:00
|
|
|
27: ImageGrid.closeOverlay, // Esc
|
2012-08-17 06:56:54 +04:00
|
|
|
|
2012-08-08 23:19:40 +04:00
|
|
|
// zooming...
|
2012-08-19 20:12:40 +04:00
|
|
|
187: ImageGrid.scaleContainerUp, // +
|
|
|
|
|
189: ImageGrid.scaleContainerDown, // -
|
2012-08-08 23:19:40 +04:00
|
|
|
// zoom presets...
|
|
|
|
|
48: {
|
2012-08-26 01:03:15 +04:00
|
|
|
'default': ImageGrid.centerCurrentImage, // 0
|
2012-08-19 19:30:59 +04:00
|
|
|
// XXX make this into a real action...
|
2012-08-26 01:03:15 +04:00
|
|
|
'ctrl': ImageGrid.fitImage, // ctrl+0
|
2012-08-08 23:19:40 +04:00
|
|
|
},
|
2012-08-19 20:12:40 +04:00
|
|
|
49: ImageGrid.fitImage, // 1
|
|
|
|
|
50: ImageGrid.fitTwoImages, // 2
|
|
|
|
|
51: ImageGrid.fitThreeImages, // 3
|
|
|
|
|
52: ImageGrid.fitFourImages, // 4
|
|
|
|
|
53: ImageGrid.fitFiveImages, // 5
|
|
|
|
|
54: ImageGrid.fitSixImages, // 6
|
|
|
|
|
55: ImageGrid.fitSevenImages, // 7
|
|
|
|
|
56: ImageGrid.fitEightImages, // 8
|
|
|
|
|
57: ImageGrid.fitNineImages, // 9
|
2012-08-08 23:19:40 +04:00
|
|
|
|
2012-08-14 22:28:33 +04:00
|
|
|
|
|
|
|
|
// navigation...
|
2012-08-19 19:30:59 +04:00
|
|
|
36: ImageGrid.firstImage, // Home
|
2012-08-22 23:37:09 +04:00
|
|
|
219: 36, // [
|
2012-08-19 19:30:59 +04:00
|
|
|
35: ImageGrid.lastImage, // End
|
2012-08-22 23:37:09 +04:00
|
|
|
221: 35, // ]
|
2012-08-10 19:40:26 +04:00
|
|
|
37: {
|
2012-08-19 19:30:59 +04:00
|
|
|
'default': ImageGrid.prevImage, // Right
|
|
|
|
|
'ctrl': ImageGrid.prevScreenImages, // ctrl-Right
|
|
|
|
|
'alt': ImageGrid.prevScreenImages, // alt-Right
|
2012-08-10 19:40:26 +04:00
|
|
|
},
|
2012-08-22 23:37:09 +04:00
|
|
|
8: 37, // BkSp
|
2012-08-26 01:03:15 +04:00
|
|
|
188: 37, // <
|
2012-08-10 19:40:26 +04:00
|
|
|
39: {
|
2012-08-19 19:30:59 +04:00
|
|
|
'default': ImageGrid.nextImage, // Left
|
|
|
|
|
'ctrl': ImageGrid.nextScreenImages, // ctrl-Left
|
|
|
|
|
'alt': ImageGrid.nextScreenImages, // alt-Left
|
2012-08-10 19:40:26 +04:00
|
|
|
},
|
2012-08-08 23:19:40 +04:00
|
|
|
32: 39, // Space
|
2012-08-26 01:03:15 +04:00
|
|
|
190: 39, // >
|
2012-08-25 01:58:27 +04:00
|
|
|
186: ImageGrid.prevScreenImages, // ;
|
|
|
|
|
222: ImageGrid.nextScreenImages, // '
|
2012-08-14 22:28:33 +04:00
|
|
|
// move view...
|
|
|
|
|
// XXX should these be s-up, s-down, ... ??
|
2012-08-19 19:30:59 +04:00
|
|
|
75: ImageGrid.moveViewUp, // k
|
|
|
|
|
74: ImageGrid.moveViewDown, // j
|
|
|
|
|
72: ImageGrid.moveViewLeft, // h
|
|
|
|
|
76: ImageGrid.moveViewRight, // l
|
2012-08-26 01:03:15 +04:00
|
|
|
// XXX use this to open...
|
|
|
|
|
//79: ImageGrid.centerCurrentImage, // o
|
2012-08-08 23:19:40 +04:00
|
|
|
|
2012-08-14 22:28:33 +04:00
|
|
|
|
|
|
|
|
// combined navigation with actions..
|
2012-08-08 23:19:40 +04:00
|
|
|
40: {
|
2012-08-19 19:30:59 +04:00
|
|
|
'default': ImageGrid.focusBelowRibbon, // Down
|
2012-08-19 21:23:29 +04:00
|
|
|
'shift': ImageGrid.shiftImageDown, // shift-Down
|
2012-08-19 21:34:31 +04:00
|
|
|
'ctrl+shift': ImageGrid.shiftImageDownNewRibbon // ctrl-shift-Down
|
2012-08-14 22:28:33 +04:00
|
|
|
},
|
2012-08-08 23:19:40 +04:00
|
|
|
38: {
|
2012-08-19 19:30:59 +04:00
|
|
|
'default': ImageGrid.focusAboveRibbon, // Up
|
2012-08-19 21:23:29 +04:00
|
|
|
'shift': ImageGrid.shiftImageUp, // shift-Up
|
2012-08-19 21:34:31 +04:00
|
|
|
'ctrl+shift': ImageGrid.shiftImageUpNewRibbon // ctrl-shift-Up
|
2012-08-08 23:19:40 +04:00
|
|
|
},
|
|
|
|
|
|
2012-08-28 02:45:32 +04:00
|
|
|
// misc actions...
|
|
|
|
|
82: ImageGrid.reverseImageOrder, // r
|
|
|
|
|
|
2012-08-08 23:19:40 +04:00
|
|
|
|
2012-08-14 22:28:33 +04:00
|
|
|
// ignore the modifiers (shift, alt, ctrl, caps)...
|
2012-08-08 23:19:40 +04:00
|
|
|
16: function(){},
|
|
|
|
|
17: 16,
|
|
|
|
|
18: 16,
|
2012-08-25 01:58:27 +04:00
|
|
|
20: 16, // Caps Lock
|
2012-08-17 07:30:03 +04:00
|
|
|
|
|
|
|
|
// refresh...
|
2012-08-19 19:30:59 +04:00
|
|
|
// XXX make this into a real action...
|
2012-08-25 01:58:27 +04:00
|
|
|
116: function(){ return DEBUG?true:false }, // F5
|
|
|
|
|
112: 116, // F12
|
2012-08-08 23:19:40 +04:00
|
|
|
}
|
2012-08-10 18:31:32 +04:00
|
|
|
|
2012-08-08 23:19:40 +04:00
|
|
|
|
|
|
|
|
|
2012-08-10 18:31:32 +04:00
|
|
|
/*********************************************************************/
|
2012-08-08 23:19:40 +04:00
|
|
|
// vim:set ts=4 sw=4 nowrap :
|