2022-03-07 18:09:49 +00:00
|
|
|
//
|
|
|
|
// 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?) {
|
2022-11-16 13:52:58 +00:00
|
|
|
mouseHandler.touchesBegan(touches: touches, event: event)
|
2022-03-07 18:09:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
open override func touchesMoved(_ touches: Set<UITouch>, with event: UIEvent?) {
|
|
|
|
mouseHandler.touchesMoved(touches: touches)
|
|
|
|
}
|
|
|
|
|
|
|
|
open override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
|
2022-11-16 13:52:58 +00:00
|
|
|
mouseHandler.touchesCancelled(touches: touches, event: event)
|
2022-03-07 18:09:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
2022-11-16 13:52:58 +00:00
|
|
|
mouseHandler.touchesEnded(touches: touches, event: event)
|
2022-03-07 18:09:49 +00:00
|
|
|
}
|
2022-11-16 13:52:58 +00:00
|
|
|
|
2022-03-07 18:09:49 +00:00
|
|
|
}
|