Skip to content

Commit 3838cd6

Browse files
fix: Better taohe controller fix (#213)
* feat: Better Controller Fix on Tahoe * Fix file comment * feat: changed swizzle --------- Co-authored-by: TheMoonThatRises <58153205+TheMoonThatRises@users.noreply.github.com>
1 parent bec13b0 commit 3838cd6

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

PlayTools.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
B127172528817C040025112B /* DiscordIPC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B127172428817C040025112B /* DiscordIPC.swift */; };
8282
B1271729288284BE0025112B /* DiscordActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1271728288284BE0025112B /* DiscordActivity.swift */; };
8383
B1E8CF8A28BBE2AB004340D3 /* Keymapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1E8CF8928BBE2AB004340D3 /* Keymapping.swift */; };
84+
B444BB0D2F49C1D100ADCC5A /* ControllerFocus.m in Sources */ = {isa = PBXBuildFile; fileRef = B444BB0B2F49C1D100ADCC5A /* ControllerFocus.m */; };
8485
B46C02C72C634AB5007637AB /* BatteryLevel.m in Sources */ = {isa = PBXBuildFile; fileRef = B46C02C62C634AB5007637AB /* BatteryLevel.m */; };
8586
B66E65002C936EA100E48FD0 /* PlayedAppleDBConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = B66E64FF2C936E9800E48FD0 /* PlayedAppleDBConstants.swift */; };
8687
B6D774FF2ACFC3D900C0D9D8 /* SwordRPC in Frameworks */ = {isa = PBXBuildFile; productRef = B6D774FE2ACFC3D900C0D9D8 /* SwordRPC */; };
@@ -181,6 +182,7 @@
181182
B127172428817C040025112B /* DiscordIPC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscordIPC.swift; sourceTree = "<group>"; };
182183
B1271728288284BE0025112B /* DiscordActivity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscordActivity.swift; sourceTree = "<group>"; };
183184
B1E8CF8928BBE2AB004340D3 /* Keymapping.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Keymapping.swift; sourceTree = "<group>"; };
185+
B444BB0B2F49C1D100ADCC5A /* ControllerFocus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ControllerFocus.m; sourceTree = "<group>"; };
184186
B46C02C62C634AB5007637AB /* BatteryLevel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BatteryLevel.m; sourceTree = "<group>"; };
185187
B46C02C82C634C60007637AB /* BatteryLevel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BatteryLevel.h; sourceTree = "<group>"; };
186188
B66E64FF2C936E9800E48FD0 /* PlayedAppleDBConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayedAppleDBConstants.swift; sourceTree = "<group>"; };
@@ -483,6 +485,7 @@
483485
6E7663A428D0FEBE00DE4AF9 /* AKPluginLoader.swift */,
484486
B46C02C62C634AB5007637AB /* BatteryLevel.m */,
485487
B46C02C82C634C60007637AB /* BatteryLevel.h */,
488+
B444BB0B2F49C1D100ADCC5A /* ControllerFocus.m */,
486489
D04B12C92EF6F3DD008FEC14 /* MediaVolume.m */,
487490
D04B12CC2EF6F3F9008FEC14 /* MediaVolume.h */,
488491
);
@@ -714,6 +717,7 @@
714717
files = (
715718
954389CA2B392D7800B063BB /* DraggableButton.swift in Sources */,
716719
9562D16D2AB505D4002C329D /* ControllerEventAdapter.swift in Sources */,
720+
B444BB0D2F49C1D100ADCC5A /* ControllerFocus.m in Sources */,
717721
AA71975A287A480D00623C15 /* Toucher.swift in Sources */,
718722
AA7197A1287A481500623C15 /* CircleMenuLoader.swift in Sources */,
719723
6E76639B28D0FAE700DE4AF9 /* Plugin.swift in Sources */,

PlayTools/Utils/ControllerFocus.m

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// ControllerFocus.m
3+
// PlayTools
4+
//
5+
// Created by Edoardo C. on 23/02/26.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
#import <GameController/GCController.h>
10+
#import <objc/runtime.h>
11+
#import <PlayTools/PlayTools-Swift.h>
12+
13+
__attribute__((visibility("hidden")))
14+
@interface BackgroundControllerLoader : NSObject
15+
@end
16+
17+
@implementation BackgroundControllerLoader
18+
+ (void)load {
19+
[GCController setShouldMonitorBackgroundEvents:YES];
20+
}
21+
@end

0 commit comments

Comments
 (0)