A demo project based on the Unity FPS Microgame template that demonstrates how to add full keyboard and mouse support to Unity iOS games. This improves the gameplay experience when running iOS games on Macs or on iPads with an external keyboard.
This demo project is made with Unity 6.3.
The keyboard-and-mouse feature requires:
- iOS 14 or later
- Input System package
All implementation files are located in the iOSInput folder.
To integrate the feature into your own project:
-
Copy the iOSInput folder into your project.
-
Call
iOSInput.Initialize()programmatically, or attach theiOSInputcomponent to your initial scene. -
Replace all references to
CursorwithiOSCursor.#if UNITY_IOS && !UNITY_EDITOR using UnityEngine.InputSystem.iOS.Extensions; #endif //... #if UNITY_IOS && !UNITY_EDITOR iOSCursor.lockState = CursorLockMode.Locked; iOSCursor.visible = false; #else Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; #endif
You can install the IPA on your iOS devices or macs using sideloading tools.
Note: If you’re running the app on iOS, you may need to disable AssistiveTouch; otherwise, the left mouse button may not work.
Note: If you’re using PlayCover on macOS, you may need to disable Keymapping in PlayCover settings; otherwise, you won’t be able to hide the mouse pointer.
All assets excluding the iOSInput folder are governed by the Unity Asset Store EULA. For more details, see FPSGame/Assets/FPS/Third-PartyNotice.txt.
The contents of the iOSInput folder are licensed under the Apache License 2.0.