working on multitouch support...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-02-20 05:07:51 +04:00
parent 65796d8150
commit 0601f07bc5

View File

@ -488,7 +488,8 @@ function makeKeyboardHandler(keybindings, unhandled){
// XXX handle multiple fingers... // XXX handle multiple touches...
// - timeout on lift to count fingers...
// XXX setup basic styles for the contained element... // XXX setup basic styles for the contained element...
// XXX revise... // XXX revise...
// XXX test on other devices... // XXX test on other devices...
@ -516,6 +517,11 @@ function makeScrollHandler(root, config){
var dt var dt
function startMoveHandler(evt, callback){ function startMoveHandler(evt, callback){
// if we are already touching then just skip on this...
if(touches > 0){
return false
}
touches = touch ? event.touches.length : 1
prev_t = event.timeStamp || Date.now(); prev_t = event.timeStamp || Date.now();
if(scroller.options.autoCancelEvents){ if(scroller.options.autoCancelEvents){
bounds = { bounds = {
@ -553,7 +559,7 @@ function makeScrollHandler(root, config){
// get the user coords... // get the user coords...
x = touch ? event.touches[0].pageX : evt.clientX x = touch ? event.touches[0].pageX : evt.clientX
y = touch ? event.touches[0].pageY : evt.clientY y = touch ? event.touches[0].pageY : evt.clientY
touches = touch ? event.touches.length : 0 touches = touch ? event.touches.length : 1
// XXX needs testing... // XXX needs testing...
// check scroll bounds... // check scroll bounds...