mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 02:00:41 +00:00
iOS: Let RApplication handle touch events when TouchMouse not enabled (#17046)
This commit is contained in:
parent
443348f014
commit
d7839bbd7d
@ -114,13 +114,7 @@ import UIKit
|
||||
}
|
||||
|
||||
public func touchesBegan(touches: Set<UITouch>, event: UIEvent?) {
|
||||
guard enabled, let touch = touches.first else {
|
||||
if #available(iOS 13.4, *), let _ = touches.first {
|
||||
let isLeftClick=(event?.buttonMask == UIEvent.ButtonMask.button(1))
|
||||
delegate?.handleMouseClick(isLeftClick: isLeftClick, isPressed: true)
|
||||
}
|
||||
return
|
||||
}
|
||||
guard enabled, let touch = touches.first else { return }
|
||||
if primaryTouch == nil {
|
||||
primaryTouch = TouchInfo(touch: touch, origin: touch.location(in: view), holdState: .wait)
|
||||
if touch.tapCount == 2 {
|
||||
@ -132,15 +126,7 @@ import UIKit
|
||||
}
|
||||
|
||||
public func touchesEnded(touches: Set<UITouch>, event: UIEvent?) {
|
||||
guard enabled else {
|
||||
if #available(iOS 13.4, *) {
|
||||
let isLeftClick=(event?.buttonMask == UIEvent.ButtonMask.button(1))
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in
|
||||
self?.delegate?.handleMouseClick(isLeftClick: isLeftClick, isPressed: false)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
guard enabled else { return }
|
||||
for touch in touches {
|
||||
if touch == primaryTouch?.touch {
|
||||
if touch.tapCount > 0 {
|
||||
@ -177,13 +163,7 @@ import UIKit
|
||||
}
|
||||
|
||||
public func touchesCancelled(touches: Set<UITouch>, event: UIEvent?) {
|
||||
guard enabled else {
|
||||
if #available(iOS 13.4, *) {
|
||||
let isLeftClick=(event?.buttonMask == UIEvent.ButtonMask.button(1))
|
||||
delegate?.handleMouseClick(isLeftClick: isLeftClick, isPressed: false)
|
||||
}
|
||||
return
|
||||
}
|
||||
guard enabled else { return }
|
||||
for touch in touches {
|
||||
if touch == primaryTouch?.touch {
|
||||
endHold()
|
||||
|
Loading…
Reference in New Issue
Block a user