-
Notifications
You must be signed in to change notification settings - Fork 2
Locking the cursor doesn't work on iPhone (iOS limitation?) #2
Comments
This adds the iPhone family to target devices for the app in Xcode, and removes the "iPad" mention in the UI. Note that Apple does not offer official pointer support on iPhone, so mice must be paired through Accessibility settings. See #2 for more discussion of the topic. iPad will remain the primary targeted device for this project.
Hi @tnmendes, thanks for your kind feedback and the suggestion to make it work on iPhone. I have tested the project on my iPhone 11 by connecting a bluetooth mouse. It works fine, however getting to this point is tricky. Apple doesn't support connecting mice to iPhone, so when you try to pair a mouse with Bluetooth settings, the mouse might not show up in the list of available devices to pair with. Additionally, there is no system-level cursor available on iPhone. To work around the Bluetooth settings not showing a mouse you can go to Accessibility settings => Switch Control => Switches => Bluetooth devices… and pair the mouse there. (in the past this has also worked for Magic Mouse however mine didn't show up in there, either) Since I couldn't get my Magic Mouse 2 connected to my iPhone, I used my Logitech MX Master 2S instead. Here's a brief video showing the cursor moving from iPhone to external display. iPhoneCursorToExternal.MOVI have updated the project to build for iPhone and am therefore closing this issue. If you have any further suggestions, please do let me know. |
Hey @conath thank you for your answer. You can check it out here: (its connect via dongle to screen) As you can see the app never changed the cursor But if open your project without being connect to external screen this is what happen: As you can see the mouse curser is in one location and the real mouse circle is one other location it's really strange the different behaviors. |
In the video I can see that you are using the AssistiveTouch cursor. Please try disabling that. It could be preventing the cursor from getting locked. (the bottom of the two switches indicates the locked state which is required “on” for moving the cursor to the external display) |
I had the idea that it was mandatory to have the AssistiveTouch on for the mouse to work. Using the external screen the same thing happens but using just the app without an external screen I can now use the mouse pointer to click on the button. I think that I have some configuration causing the issue of the behavior being different from yours. Can you have a look at this print screen to check if are equal to yours? |
I have the same settings, both Assistive Touch and Switch Control are off. The difference was that I didn’t get the iOS cursor at all on my iPhone - turns out I had somehow managed to turn it invisible using various other settings. Anyway, all of this to say that I have no idea why it’s not locking the cursor on iPhone. According to Apple Documentation, it is supported on iOS. https://developer.apple.com/documentation/uikit/uiviewcontroller/3601235-preferspointerlocked/ |
However, in the WWDC20 talk where it was introduced, the pointer locking feature was only demoed and mentioned in connection with iPadOS. https://developer.apple.com/videos/play/wwdc2020/10617/ |
September is coming soon, it may be that iOS 15 has new features for iPhones regarding support for mouse 🙏 |
After all, I have new updates! I am not sure what I did, maybe was the reboot of the phone but now it's working as you have on your phone. I can't see the assistance circle but I know it's there. In the video you can see that I have the mouse a little more to the left of the button but when I click it works so it's the circle that is there. |
We may have found an iOS bug where the cursor goes invisible. ¯_(ツ)_/¯ |
I'm finding that a year after, and a long time ago with a USB to lightning cable I connected a mouse and the mouse was invisible, yet it worked. |
Wowww....this project really worked well on iPadOS + external screen Kudos to you :D
I changed the priorities to work also with iPhone but that didn't work do you have any "hack" to have this working with iPhone?
Thanks in advance!!!
The text was updated successfully, but these errors were encountered: