Files
ppsspp/ios/Controls.h
T
Henrik RydgårdandClaude Opus 5.5 234917043f iOS: Accept controllers without thumbsticks
- Fixes #22365

Controllers with no sticks, like the 8BitDo FlipPad, don't get an extended
gamepad profile, so InitController ignored them. Fall back to looking up
the same buttons in the physical input profile by name, requiring at least
an A button and a D-pad, and log the element names it found.

Such a pad can have a micro gamepad profile, which InitSiriRemote would
have taken as a remote, so it now skips anything with a B button.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 11:14:30 +02:00

43 lines
1.3 KiB
Objective-C

#pragma once
#include <string_view>
#include "ppsspp_config.h"
#import <GameController/GameController.h>
#if !PPSSPP_PLATFORM(TVOS)
#import <CoreMotion/CoreMotion.h>
#endif
#include "Common/Input/InputState.h"
// Code extracted from ViewController.mm, in order to modularize
// and share it between multiple view controllers.
bool InitController(GCController *controller);
void ShutdownController(GCController *controller);
// Returns false unless the controller is a Siri Remote (a micro gamepad profile, no extended one and no B button).
bool InitSiriRemote(GCController *controller);
struct TouchTracker {
public:
void Began(NSSet *touches, UIView *view);
void Moved(NSSet *touches, UIView *view);
void Ended(NSSet *touches, UIView *view);
void Cancelled(NSSet *touches, UIView *view);
private:
void SendTouchEvent(CGPoint point, UIView *view, int code, int pointerId);
int ToTouchID(UITouch *uiTouch, bool allowAllocate);
UITouch *touches_[10]{};
};
#if !PPSSPP_PLATFORM(TVOS)
void ProcessAccelerometerData(CMAccelerometerData *accData);
void ProcessGyroData(CMGyroData *gyroData);
#endif
InputKeyCode HIDUsageToInputKeyCode(UIKeyboardHIDUsage usage);
void KeyboardPressesBegan(NSSet<UIPress *> *presses, UIPressesEvent *event);
void KeyboardPressesEnded(NSSet<UIPress *> *presses, UIPressesEvent *event);
void SendKeyboardChars(std::string_view str);