With On Virtual Keyboard Hidden
I’m using the On Virtual Keyboard Shown delegate to handle the event when the textbox is focused. I found the relevant delegate but I’m not sure how to bind Do you know anyone?
// MyActor.h
void MyTestFunction(FPlatformRect Rect);
// MyActor.cpp
OnVirtualKeyboardShown().AddUObject(this, &ThisClass::MyTestFunction);
yeah you should get the delegate first so you can bind function to it.
here is the example:
// yourClass.h
#include"GenericPlatform/GenericApplication.h"
// create a func to bind
void FunctionToBind();
// yourClass.cpp
// find a place to put this code in , such as the construct function
// get the singleton
TSharedPtr<GenericApplication> App = FSlateApplication::Get().GetPlatformApplication();
// get the delegate
if (App != nullptr && App.IsValid()){
App -> OnVirtualKeyboardShown().AddUObject(this, <FunctionToBind>);
}
That’s All. I use this function in PE-Game so i can know when the keyboard come out.