2012-08-10 18:31:32 +04:00
|
|
|
/*********************************************************************/
|
2012-08-10 20:44:48 +04:00
|
|
|
// NOTE: use String.fromCharCode(code)...
|
2012-08-08 23:19:40 +04:00
|
|
|
var keybindings = {
|
2012-08-14 22:28:33 +04:00
|
|
|
// togglable modes and options...
|
2012-08-19 19:30:59 +04:00
|
|
|
191: ImageGrid.showSetup, // ?
|
2012-08-14 23:40:26 +04:00
|
|
|
70: ImageGrid.toggleSingleImageMode, // f
|
|
|
|
|
83: ImageGrid.toggleSingleRibbonMode, // s
|
2012-08-08 23:19:40 +04:00
|
|
|
13: 70, // Enter
|
2012-08-15 04:03:11 +04:00
|
|
|
84: ImageGrid.toggleSingleImageModeTransitions, // t
|
|
|
|
|
65: ImageGrid.toggleTransitions, // a
|
|
|
|
|
9: ImageGrid.toggleControls, // tab
|
2012-08-08 23:19:40 +04:00
|
|
|
66: toggleBackgroundModes, // b
|
|
|
|
|
77: toggleMarkers, // m
|
|
|
|
|
|
2012-08-14 22:28:33 +04:00
|
|
|
|
2012-08-19 19:30:59 +04:00
|
|
|
27: [
|
|
|
|
|
// XXX make this into a real action...
|
|
|
|
|
function(){$('.overlay').click()}, // Esc
|
|
|
|
|
'Hide overlay'
|
|
|
|
|
],
|
2012-08-17 06:56:54 +04:00
|
|
|
|
2012-08-08 23:19:40 +04:00
|
|
|
// zooming...
|
2012-08-19 19:30:59 +04:00
|
|
|
// XXX make this into a real action...
|
2012-08-15 03:02:27 +04:00
|
|
|
187: function(){scaleContainerBy(ImageGrid.option.ZOOM_FACTOR)}, // +
|
2012-08-19 19:30:59 +04:00
|
|
|
// XXX make this into a real action...
|
2012-08-15 03:02:27 +04:00
|
|
|
189: function(){scaleContainerBy(1/ImageGrid.option.ZOOM_FACTOR)}, // -
|
2012-08-08 23:19:40 +04:00
|
|
|
// zoom presets...
|
|
|
|
|
48: {
|
|
|
|
|
'default': fitImage, // 0
|
2012-08-19 19:30:59 +04:00
|
|
|
// XXX make this into a real action...
|
2012-08-08 23:19:40 +04:00
|
|
|
'ctrl': function(){setContainerScale(1)}, // ctrl+0
|
|
|
|
|
},
|
2012-08-19 19:30:59 +04:00
|
|
|
49: fitImage, // 1
|
|
|
|
|
50: fitTwoImages, // 2
|
2012-08-08 23:19:40 +04:00
|
|
|
51: fitThreeImages, // 3
|
2012-08-19 19:30:59 +04:00
|
|
|
52: fitFourImages, // 4
|
|
|
|
|
53: fitFiveImages, // 5
|
|
|
|
|
54: fitSixImages, // 6
|
|
|
|
|
55: fitSevenImages, // 7
|
|
|
|
|
56: fitEightImages, // 8
|
|
|
|
|
57: 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
|
|
|
|
|
35: ImageGrid.lastImage, // End
|
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-08 23:19:40 +04:00
|
|
|
80: 37, // BkSp
|
|
|
|
|
188: 37, // p
|
|
|
|
|
8: 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
|
|
|
|
|
190: 39, // m
|
|
|
|
|
78: 39, // >
|
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
|
|
|
|
|
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-08 23:19:40 +04:00
|
|
|
'shift': shiftImageDown, // shift-Down
|
2012-08-19 19:30:59 +04:00
|
|
|
// XXX make this into a real action...
|
2012-08-08 23:19:40 +04:00
|
|
|
'ctrl+shift': function(){ // ctrl-shift-Down
|
|
|
|
|
createRibbon('next')
|
|
|
|
|
shiftImageDown()
|
|
|
|
|
}
|
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-08 23:19:40 +04:00
|
|
|
'shift': shiftImageUp, // shift-Up
|
2012-08-19 19:30:59 +04:00
|
|
|
// XXX make this into a real action...
|
2012-08-08 23:19:40 +04:00
|
|
|
'ctrl+shift': function(){ // ctrl-shift-Up
|
|
|
|
|
createRibbon('prev')
|
|
|
|
|
shiftImageUp()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
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-10 20:44:48 +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-17 07:30:03 +04:00
|
|
|
116: function(){ return DEBUG?true:false } // F5
|
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 :
|