mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
fixed a bug in keyboard.js...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ad82c98a91
commit
bd7aaf0a68
@ -1058,6 +1058,8 @@ function makeKeyboardHandler(keyboard, unhandled, actions){
|
|||||||
// This will extend the keyboard object by adding:
|
// This will extend the keyboard object by adding:
|
||||||
// .pauseRepeat() - will pause repeating keys...
|
// .pauseRepeat() - will pause repeating keys...
|
||||||
//
|
//
|
||||||
|
// XXX should we drop only when the same key is repeating or any keys
|
||||||
|
// repeating (as is now)???
|
||||||
var makePausableKeyboardHandler =
|
var makePausableKeyboardHandler =
|
||||||
module.makePausableKeyboardHandler =
|
module.makePausableKeyboardHandler =
|
||||||
function makePausableKeyboardHandler(keyboard, unhandled, actions, check_interval){
|
function makePausableKeyboardHandler(keyboard, unhandled, actions, check_interval){
|
||||||
@ -1067,23 +1069,25 @@ function makePausableKeyboardHandler(keyboard, unhandled, actions, check_interva
|
|||||||
//: Keyboard(keyboard, checkGlobalMode)
|
//: Keyboard(keyboard, checkGlobalMode)
|
||||||
: Keyboard(keyboard)
|
: Keyboard(keyboard)
|
||||||
|
|
||||||
kb.pauseRepeat = function(){ this.__repeat_paused = true }
|
kb.pauseRepeat = function(){
|
||||||
|
this.__repeat_pause_timeout
|
||||||
|
&& clearTimeout(this.__repeat_pause_timeout)
|
||||||
|
|
||||||
|
this.__repeat_pause_timeout = setTimeout(
|
||||||
|
function(){
|
||||||
|
delete kb.__repeat_pause_timeout
|
||||||
|
},
|
||||||
|
(check_interval instanceof Function ?
|
||||||
|
check_interval.call(actions)
|
||||||
|
: (check_interval || 100)))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return stoppableKeyboardRepeat(
|
return stoppableKeyboardRepeat(
|
||||||
makeKeyboardHandler(kb, unhandled, actions),
|
makeKeyboardHandler(kb, unhandled, actions),
|
||||||
function(){
|
function(){
|
||||||
if(kb.__repeat_paused){
|
if(kb.__repeat_pause_timeout){
|
||||||
var that = this
|
kb.pauseRepeat()
|
||||||
kb.__repeat_pause_timeout
|
|
||||||
&& clearTimeout(kb.__repeat_pause_timeout)
|
|
||||||
|
|
||||||
kb.__repeat_pause_timeout = setTimeout(function(){
|
|
||||||
delete kb.__repeat_paused
|
|
||||||
delete kb.__repeat_pause_timeout
|
|
||||||
}, (check_interval instanceof Function ?
|
|
||||||
check_interval.call(actions)
|
|
||||||
: (check_interval || 100)))
|
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user