I am updating my browser app to support Windows Phone 8.1 and I noticed the MSGestureHold
event is not raised.
To reproduce this error,
IsScriptEnabled="True"
. Sample 1: handling the hold gesture
section and click the IE11 users test . Notice that MSGestureHold
is not working.
However the project is working when tested in
Is this a bug?
I guess this is the WebBrowser control's bug.
I test several gesture events with WebBrowser control for WP8.1, such as pointerdown , MSGestureHold , MSGestureChange ,and MSGestureTap . Finally, pointerdown , MSGestureChange and MSGestureTap can be triggered normally,except MSGestureHold . So I guess this is a bug .
This code works fine in webview for WPhone 8.1 apps :
var init = function(){
var myState = // context
var target = // DOM variable target
var msg = new MSGesture();
msg.target = target;
target.addEventListener("MSGestureHold", function (evt) { buttonTactileListener.apply(myState, [evt, msg]); }, false);
target.addEventListener("pointerdown", function (evt) { buttonTactileListener.apply(myState, [evt, msg]); }, false);
target.addEventListener("MSGestureEnd", function (evt) { buttonTactileListener.apply(myState, [evt, msg]); }, false);
}
var buttonTactileListener = function (evt, msgesture) {
var myState = this;
if (evt.type == "pointerdown") {
msgesture.addPointer(evt.pointerId);
return;
}
if (evt.type == "MSGestureHold") {
///do something
return;
}
if (evt.type == "MSGestureEnd") {
// renew instance of handler
msgesture = new MSGesture();
msgesture.target = evt.target;
return;
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.