RetroArch/pkg/apple/MouseEmulation/CocoaView+MouseSupport.swift
Richard 5e9e5177ec
feat(iOS13.4): Add Trackpad Support(iOS13.4 and above) (#14633)
Co-authored-by: Yuki Fushimi <seiryu@Yukis-MacBook-Pro.local>
2022-11-16 14:52:58 +01:00

31 lines
959 B
Swift

//
// CocoaView+MouseSupport.swift
// RetroArchiOS
//
// Created by Yoshi Sugawara on 3/2/22.
// Copyright © 2022 RetroArch. All rights reserved.
//
extension CocoaView {
@objc func setupMouseSupport() {
mouseHandler = EmulatorTouchMouseHandler(view: view, delegate: self as? EmulatorTouchMouseHandlerDelegate)
}
open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
mouseHandler.touchesBegan(touches: touches, event: event)
}
open override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
mouseHandler.touchesMoved(touches: touches)
}
open override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
mouseHandler.touchesCancelled(touches: touches, event: event)
}
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
mouseHandler.touchesEnded(touches: touches, event: event)
}
}