-
-
Notifications
You must be signed in to change notification settings - Fork 53
GetKey
Otavio edited this page Dec 5, 2022
·
2 revisions
This functions returns the current key set/selected on the widget.
This function returns an unsigned int
.
This function can be used to get the current key that is set/selected on a widget.
List of widgets that are using this function:
- Container
- KeyBinder
Let's say I want to run a piece of code if the user is pressing the key selected on the KeyBinder:
if (FGUI::INPUT.IsKeyPressed(KeyBinder->GetKey()) {
// the code will run when the user press the selected key on the KeyBinder.
}
// or
if (FGUI::INPUT.IsKeyHeld(KeyBinder->GetKey()) {
// the code will run when the user holds the selected key on the KeyBinder.
}
Next you will learn about the GetText function.
You can also read the library comments/functions for additional info.