-
As a complete GIU-novice I am using GIU to design a simple window for a text adventure game. It consists of a label at the top which will contain some information about the player's location. Below that is a read-only multiline input widget which will contain all previous user input & responses given by the game. This should behave a bit like the output of a "console/terminal" window. Below that is a label stating "What now?" and an input text widget for the user to input the next command. Border and background are set to the same color as the window background, so it resembles the look of a "command prompt". In the future I might want to add a menu bar at the top of the screen (above the previously mentioned title label) for loading & saving the current game state etc. I would like to set the default focus on the input widget, so the user doesn't have to click it to set the focus. Plus I would like to capture when the "enter" key was pressed, to invoke the interpreter to handle the given input and set the focus back to the input widget after the command response has returned. Is there a way to achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
for enter see #158 |
Beta Was this translation helpful? Give feedback.
ok, here is some code but it doesn't catch enter for some reason 🤔