1
General / Text Input with Thor
« on: October 11, 2018, 06:23:16 pm »
I recently started using Thor and I encountered this problem. Before using Thor I would create text input fields like this:
With the action maping system of Thor however I have no idea how to get to the event.text.unicode
Thanks in advance!
sf::Event event;
while (this->window->getWindow()->pollEvent(event))
{
if (event.type == sf::Event::TextEntered)
{
if (event.text.unicode < 128) {
if (event.text.unicode == 8) { // backspace
if (raw.length() > 0) raw = raw.substr(0, raw.size() - 1);
}
else if (event.text.unicode == 13) { // enter
entered = true;
}
else {
raw += (char)event.text.unicode;
}
}
}
}
while (this->window->getWindow()->pollEvent(event))
{
if (event.type == sf::Event::TextEntered)
{
if (event.text.unicode < 128) {
if (event.text.unicode == 8) { // backspace
if (raw.length() > 0) raw = raw.substr(0, raw.size() - 1);
}
else if (event.text.unicode == 13) { // enter
entered = true;
}
else {
raw += (char)event.text.unicode;
}
}
}
}
With the action maping system of Thor however I have no idea how to get to the event.text.unicode
Thanks in advance!