fixed: direction pad on-screen widget (Wasdpad, dPad ...) not responsive on first touch move
This commit is contained in:
1 parent
3f2a011d7b
commit
297f5ad7e6
1 file changed
+5
-2
@@ -178,6 +178,7 @@ import UIKit
|
|||||||
// for mousePad
|
// for mousePad
|
||||||
private var touchLockedForMoveEvent: UITouch
|
private var touchLockedForMoveEvent: UITouch
|
||||||
private var touchBegan: Bool = false
|
private var touchBegan: Bool = false
|
||||||
|
private var directionPadTouchBegan: Bool = false
|
||||||
private var firstTouchMoved: Bool = false
|
private var firstTouchMoved: Bool = false
|
||||||
private var mousePointerMoved: Bool
|
private var mousePointerMoved: Bool
|
||||||
private var twoTouchesDetected: Bool
|
private var twoTouchesDetected: Bool
|
||||||
@@ -938,7 +939,8 @@ import UIKit
|
|||||||
}
|
}
|
||||||
if nearZeroPoint {pressedButtonMask = 0}
|
if nearZeroPoint {pressedButtonMask = 0}
|
||||||
|
|
||||||
if pressedButtonMask != previousButtonMask {
|
if pressedButtonMask != previousButtonMask || directionPadTouchBegan {
|
||||||
|
directionPadTouchBegan = false
|
||||||
if(pressedButtonMask & Direction.up.rawValue == Direction.up.rawValue) {
|
if(pressedButtonMask & Direction.up.rawValue == Direction.up.rawValue) {
|
||||||
showLrudDirectionIndicator(with: upIndicator)
|
showLrudDirectionIndicator(with: upIndicator)
|
||||||
switch touchPadString {
|
switch touchPadString {
|
||||||
@@ -1175,7 +1177,7 @@ import UIKit
|
|||||||
else {self.buttonDownVisualEffectWidth = 9}
|
else {self.buttonDownVisualEffectWidth = 9}
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.motionControlButtonString != "" {self.buttonDownVisualEffectWidth = 4}
|
if self.motionControlButtonString != "" {self.buttonDownVisualEffectWidth = 3}
|
||||||
|
|
||||||
// Set the frame to be larger than the view to expand outward
|
// Set the frame to be larger than the view to expand outward
|
||||||
buttonDownVisualEffectLayer.borderWidth = 0 // set this 0 to hide the visual effect first
|
buttonDownVisualEffectLayer.borderWidth = 0 // set this 0 to hide the visual effect first
|
||||||
@@ -1326,6 +1328,7 @@ import UIKit
|
|||||||
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
|
|
||||||
self.touchBegan = true
|
self.touchBegan = true
|
||||||
|
self.directionPadTouchBegan = true
|
||||||
self.firstTouchMoved = false
|
self.firstTouchMoved = false
|
||||||
super.touchesBegan(touches, with: event)
|
super.touchesBegan(touches, with: event)
|
||||||
self.isMultipleTouchEnabled = self.widgetType == WidgetTypeEnum.button || self.touchPadString == "MOUSEPAD";
|
self.isMultipleTouchEnabled = self.widgetType == WidgetTypeEnum.button || self.touchPadString == "MOUSEPAD";
|
||||||
|
|||||||
Reference in new issue
Block a user