Files
ppsspp/ios/Controls.h
T
Henrik RydgårdandClaude Opus 5.5 3a8a1799ee Add a tvOS build of the app
Shares the iOS frontend, with camera, location, motion, photo/document
pickers, share sheet, clipboard, microphone, battery and rotation compiled
out. The view controller is a GCEventViewController, so controllers only
reach us through GCController, and the Siri Remote is read as a micro
gamepad and sent as arrow/enter/escape/back keys. tvOS has no persistent
storage besides NSUserDefaults, so the memory stick lives in Caches for now.

Configure with -DIOS_PLATFORM=TVOS. The MoltenVK submodule gets the tvOS
slice from the same stock v1.4.2 release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 01:06:55 +02:00

44 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);
#if PPSSPP_PLATFORM(TVOS)
// Returns false unless the controller is a Siri Remote (a micro gamepad profile and no extended one).
bool InitSiriRemote(GCController *controller);
#endif
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);
#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);