fixed: legacy on-screen control layers pass through native touch events
This commit is contained in:
1 parent
9c518dfeb6
commit
99952281cb
2 files changed
+8
-2
No files matched your search
@@ -213,6 +213,7 @@
|
|||||||
if (asyncNativeTouch) dispatch_async(dispatch_get_global_queue(touchDownQos, 0), ^{
|
if (asyncNativeTouch) dispatch_async(dispatch_get_global_queue(touchDownQos, 0), ^{
|
||||||
for (UITouch* touch in touches){
|
for (UITouch* touch in touches){
|
||||||
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch
|
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch
|
||||||
|
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
|
||||||
[self handleTouchDown:touch]; //generate & populate pointerId
|
[self handleTouchDown:touch]; //generate & populate pointerId
|
||||||
if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
|
if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
|
||||||
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
|
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
|
||||||
@@ -221,6 +222,7 @@
|
|||||||
else{
|
else{
|
||||||
for (UITouch* touch in touches){
|
for (UITouch* touch in touches){
|
||||||
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch
|
// continue to the next loop if current touch is already captured by OSC. works only in regular native touch
|
||||||
|
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
|
||||||
[self handleTouchDown:touch]; //generate & populate pointerId
|
[self handleTouchDown:touch]; //generate & populate pointerId
|
||||||
if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
|
if(self->activateCoordSelector) [self populatePointerObjIntoDict:touch];
|
||||||
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
|
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_DOWN];
|
||||||
@@ -242,7 +244,11 @@
|
|||||||
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
|
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, moveEventIntervalNSec), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, moveEventIntervalNSec), dispatch_get_main_queue(), ^{
|
||||||
for (UITouch* touch in touches){
|
for (UITouch* touch in touches){
|
||||||
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) continue;
|
NSNumber* touchAddrObj = @((uintptr_t)touch);
|
||||||
|
if([OnScreenControls.touchAddrsCapturedByOnScreenControls containsObject:touchAddrObj]){
|
||||||
|
[OnScreenControls.touchAddrsCapturedByOnScreenControls removeObject:touchAddrObj];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_UP]; //send touch event before remove pointerId
|
[self sendTouchEvent:touch withTouchtype:LI_TOUCH_EVENT_UP]; //send touch event before remove pointerId
|
||||||
[self removePointerId:touch]; //then remove pointerId
|
[self removePointerId:touch]; //then remove pointerId
|
||||||
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
|
if(self->activateCoordSelector) [self removePointerObjFromDict:touch];
|
||||||
|
|||||||
@@ -1437,7 +1437,7 @@ static float L3_Y;
|
|||||||
for (UITouch* touch in touches) {
|
for (UITouch* touch in touches) {
|
||||||
|
|
||||||
// remove the touch obj from touchesCapturedByOnScreenButtons
|
// remove the touch obj from touchesCapturedByOnScreenButtons
|
||||||
if([touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) [touchAddrsCapturedByOnScreenControls removeObject:@((uintptr_t)touch)];
|
// if([touchAddrsCapturedByOnScreenControls containsObject:@((uintptr_t)touch)]) [touchAddrsCapturedByOnScreenControls removeObject:@((uintptr_t)touch)];
|
||||||
|
|
||||||
if (touch == _aTouch) {
|
if (touch == _aTouch) {
|
||||||
[_controllerSupport clearButtonFlag:_controller flags:A_FLAG];
|
[_controllerSupport clearButtonFlag:_controller flags:A_FLAG];
|
||||||
|
|||||||
Reference in new issue
Block a user