File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
Source/Core/InputCommon/ControllerInterface/iOS Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 77
88@interface MFiControllerScanner : NSObject
99
10+ @property (nonatomic , strong ) NSMutableArray * keyboards;
11+
1012@end
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ - (id)init
1515{
1616 if (self = [super init ])
1717 {
18+ _keyboards = [[NSMutableArray alloc ] init ];
19+
1820 [[NSNotificationCenter defaultCenter ] addObserver: self
1921 selector: @selector (controllerConnected: )
2022 name: GCControllerDidConnectNotification
@@ -61,6 +63,7 @@ - (void)keyboardConnected:(NSNotification*)notification
6163{
6264 GCKeyboard* keyboard = (GCKeyboard*)notification.object ;
6365 g_controller_interface.AddDevice (std::make_shared<ciface::iOS::MFiKeyboard>(keyboard));
66+ [_keyboards addObject: keyboard];
6467}
6568
6669- (void )keyboardDisconnected : (NSNotification *)notification
@@ -70,6 +73,7 @@ - (void)keyboardDisconnected:(NSNotification*)notification
7073 dynamic_cast <const ciface::iOS::MFiKeyboard*>(device);
7174 return keyboard != nullptr ;
7275 });
76+ [_keyboards removeObject: notification.object];
7377}
7478
7579@end
Original file line number Diff line number Diff line change 55
66#include " InputCommon/ControllerInterface/iOS/MFiController.h"
77#include " InputCommon/ControllerInterface/iOS/MFiControllerScanner.h"
8+ #include " InputCommon/ControllerInterface/iOS/MFiKeyboard.h"
89#include " InputCommon/ControllerInterface/iOS/StateManager.h"
910#include " InputCommon/ControllerInterface/iOS/Touchscreen.h"
1011
4950
5051 for (GCController* controller in [GCController controllers ])
5152 g_controller_interface.AddDevice (std::make_shared<MFiController>(controller));
53+
54+ for (GCKeyboard* keyboard in [m_mfi_scanner keyboards ])
55+ g_controller_interface.AddDevice (std::make_shared<MFiKeyboard>(keyboard));
5256}
5357} // namespace ciface::iOS
You can’t perform that action at this time.
0 commit comments