How to use usb mouse and keyboard on android device

Hello!

I try to use usb keyboard and mouse on my project. I plug mouse to phone via adapter and I may control phone by mouse (cursor and left click). If keyboard plugged I may type text on android text inputs. But if I launch my project on phone I see mouse cursor but left click not working. Keyboard not react on button press. In editor mouse and keyboard working fine but not on android device. Build for Android (ATC).

Settings

Level BP

Player Controller

Game Mode

Please help.

Hi!

Since 4.20 Epic introdused console variables:

Android.EnableMouse (default 0)

Android.EnableHardwareKeyboard (default 0)

You can set them in Config\DefaultEngine.ini under [SystemSettings]

[URL]
GameName=MyUEAndroidProject

[SystemSettings]
Android.EnableMouse=1
Android.EnableHardwareKeyboard=1
1 Like

Hello, Dmitry!

Thanks a lot! It works