From 33e01e084771ac85e8bd298aef05fe7e255eb9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20A=2E=20A=CC=81lvarez?= Date: Sat, 10 Feb 2024 12:19:20 +0100 Subject: [PATCH] visionOS: always use touchscreen --- Mini vMac/ViewController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Mini vMac/ViewController.m b/Mini vMac/ViewController.m index be6fdcc..193d475 100644 --- a/Mini vMac/ViewController.m +++ b/Mini vMac/ViewController.m @@ -166,8 +166,12 @@ API_AVAILABLE(ios(13.4)) } #endif +#if defined(TARGET_OS_VISION) && TARGET_OS_VISION == 1 + Class pointingDeviceClass = [TouchScreen class]; +#else BOOL useTrackPad = [[NSUserDefaults standardUserDefaults] boolForKey:@"trackpad"]; Class pointingDeviceClass = useTrackPad ? [TrackPad class] : [TouchScreen class]; +#endif pointingDeviceView = [[pointingDeviceClass alloc] initWithFrame:self.view.bounds]; pointingDeviceView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.view insertSubview:pointingDeviceView aboveSubview:self.screenView];