RetroArch/pkg/apple/MouseEmulation/CocoaView+MouseSupport.swift
yoshisuga 01cb10d8b3
[iOS 13+] Support a toolbar that allows toggling of onscreen keyboard and touch mouse (#13700)
* Fetch translations from Crowdin

* Support for showing and hiding indicator and navigation bar

* Refactored to use a view model

* Support defining helper bar items and support showing/hiding keyboard

* reorganized source files into separate logical files

* Moved mouse support to swift (except for delegate implementation), added support for enabling touch mouse in helper bar; reorganized swift source files

* Reorganized keyboard files; added the touch mouse messages to the RA localization files; use the RA notification system

* change keyboard letters to uppercase for clarity

Co-authored-by: github-actions <github-actions@github.com>
2022-03-07 19:09:49 +01:00

30 lines
913 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)
}
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)
}
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
mouseHandler.touchesEnded(touches: touches)
}
}