jkuhlmann / gainput

Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
http://gainput.johanneskuhlmann.de/
MIT License
858 stars 103 forks source link

[iOS] Issue with touch pressure + Fix #56

Open antoineMica opened 6 years ago

antoineMica commented 6 years ago

I'm currently working on an app based on a GameViewCotnroller + Metalkit. I have added the Gainputview as a subview to the MTKView but I have found an issue with the function initWithFrame of GainputView when trying to detect the iOS windows. Coming from this line: https://github.com/jkuhlmann/gainput/blob/4973ae4e8a6b733310a44a927ab41631e074f997/lib/source/gainput/GainputIos.mm#L37

I have replaced it with: UIWindow* window = [[[UIApplication sharedApplication] delegate] window]; And it now detects the window correctly.