mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
reworked keyborad shortcuts...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3c2dd781b9
commit
ee888deb1b
@ -123,16 +123,19 @@ function handleClick(e) {
|
|||||||
|
|
||||||
var keys = {
|
var keys = {
|
||||||
toggleHelpKeys: [72],
|
toggleHelpKeys: [72],
|
||||||
toggleRibbonView: [32],
|
toggleRibbonView: [70],
|
||||||
closeKeys: [27, 88, 67],
|
closeKeys: [27, 88, 67],
|
||||||
|
|
||||||
firstKeys: [36],
|
firstKeys: [36],
|
||||||
lastKeys: [35],
|
lastKeys: [35],
|
||||||
previousKeys: [37, 80],
|
previousKeys: [37, 80, 188, 8],
|
||||||
nextKeys: [39, 78],
|
nextKeys: [39, 78, 190, 32],
|
||||||
promoteKeys: [40],
|
// these work with ctrl and shift modifiers...
|
||||||
// XXX add del (46) to demote...
|
downKeys: [40],
|
||||||
demoteKeys: [38],
|
upKeys: [38],
|
||||||
|
// these work with ctrl modifier...
|
||||||
|
promoteKeys: [45],
|
||||||
|
demoteKeys: [46],
|
||||||
|
|
||||||
ignoreKeys: [16, 17, 18],
|
ignoreKeys: [16, 17, 18],
|
||||||
|
|
||||||
@ -147,6 +150,18 @@ function handleKeys(event){
|
|||||||
: (fn(code, keys.previousKeys) >= 0) ? prevImage()
|
: (fn(code, keys.previousKeys) >= 0) ? prevImage()
|
||||||
: (fn(code, keys.lastKeys) >= 0) ? lastImage()
|
: (fn(code, keys.lastKeys) >= 0) ? lastImage()
|
||||||
: (fn(code, keys.promoteKeys) >= 0) ? function(){
|
: (fn(code, keys.promoteKeys) >= 0) ? function(){
|
||||||
|
if(event.ctrlKey){
|
||||||
|
createRibbonBelow()
|
||||||
|
}
|
||||||
|
promoteImage()
|
||||||
|
}()
|
||||||
|
: (fn(code, keys.demoteKeys) >= 0) ? function(){
|
||||||
|
if(event.ctrlKey){
|
||||||
|
createRibbonAbove()
|
||||||
|
}
|
||||||
|
demoteImage()
|
||||||
|
}()
|
||||||
|
: (fn(code, keys.downKeys) >= 0) ? function(){
|
||||||
if(event.shiftKey){
|
if(event.shiftKey){
|
||||||
if(event.ctrlKey){
|
if(event.ctrlKey){
|
||||||
createRibbonBelow()
|
createRibbonBelow()
|
||||||
@ -156,7 +171,7 @@ function handleKeys(event){
|
|||||||
focusBelowRibbon()
|
focusBelowRibbon()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
: (fn(code, keys.demoteKeys) >= 0) ? function(){
|
: (fn(code, keys.upKeys) >= 0) ? function(){
|
||||||
if(event.shiftKey){
|
if(event.shiftKey){
|
||||||
if(event.ctrlKey){
|
if(event.ctrlKey){
|
||||||
createRibbonAbove()
|
createRibbonAbove()
|
||||||
|
|||||||
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
<button onclick="showSingle()">single</button>
|
<button onclick="showSingle()">single</button>
|
||||||
<button onclick="showRibbon()">ribbon</button>
|
<button onclick="showRibbon()">ribbon</button>
|
||||||
<button onclick="toggleRibbonView()">toggle ribbon view (space)</button>
|
<button onclick="toggleRibbonView()">toggle ribbon view (f)</button>
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user