Implemented mouse relative mode for iOS 14.1 and newer

This commit is contained in:
Sam Lantinga
2021-07-08 07:23:29 -07:00
parent 3433f3c4cc
commit 46f19c311d
9 changed files with 80 additions and 23 deletions

View File

@@ -27,8 +27,9 @@
#include "../SDL_sysvideo.h"
#include "../../events/SDL_events_c.h"
#import "SDL_uikitviewcontroller.h"
#import "SDL_uikitmessagebox.h"
#include "SDL_uikitviewcontroller.h"
#include "SDL_uikitmessagebox.h"
#include "SDL_uikitevents.h"
#include "SDL_uikitvideo.h"
#include "SDL_uikitmodes.h"
#include "SDL_uikitwindow.h"
@@ -246,7 +247,20 @@ SDL_HideHomeIndicatorHintChanged(void *userdata, const char *name, const char *o
return UIRectEdgeNone;
}
}
#endif
- (BOOL)prefersPointerLocked
{
SDL_VideoDevice *_this = SDL_GetVideoDevice();
if (SDL_HasGCMouse() &&
(SDL_GCMouseRelativeMode() || _this->grabbed_window == window)) {
return YES;
} else {
return NO;
}
}
#endif /* !TARGET_OS_TV */
/*
---- Keyboard related functionality below this line ----