Fix using Keyboard and Mouse in C# scripting

This commit is contained in:
Wojtek Figat
2021-06-02 09:48:02 +02:00
parent 398fc4be37
commit 33b31f9155
5 changed files with 20 additions and 20 deletions

View File

@@ -260,7 +260,7 @@ namespace
String AppPackageName, DeviceManufacturer, DeviceModel, DeviceBuildNumber;
String SystemVersion, SystemLanguage, CacheDir, ExecutablePath;
byte MacAddress[6];
AndroidKeyboard KeyboardImpl;
AndroidKeyboard* KeyboardImpl;
AndroidDeviceGamepad* GamepadImpl;
AndroidTouchScreen* TouchScreenImpl;
ScreenOrientationType Orientation;
@@ -496,9 +496,9 @@ namespace
if (eventType.KeyboardKey != KeyboardKeys::None)
{
if (isDown)
KeyboardImpl.OnKeyDown(eventType.KeyboardKey);
KeyboardImpl->OnKeyDown(eventType.KeyboardKey);
else
KeyboardImpl.OnKeyUp(eventType.KeyboardKey);
KeyboardImpl->OnKeyUp(eventType.KeyboardKey);
}
// Gamepad
@@ -850,7 +850,7 @@ bool AndroidPlatform::Init()
}
// Setup native platform input devices
Input::Keyboard = &KeyboardImpl;
Input::Keyboard = KeyboardImpl = New<AndroidKeyboard>();
Input::Gamepads.Add(GamepadImpl = New<AndroidDeviceGamepad>());
Input::OnGamepadsChanged();
Input::CustomDevices.Add(TouchScreenImpl = New<AndroidTouchScreen>());