Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been coding a simple logic game recently and there is a UI decision that has been bothering me.

Since certain blocks of logic are going to be used across many levels (e.g. logic to reverse the input queue) I decided to add a template feature, allowing the user to name and save blocks of logic.

As it stands, I simply have a text field in which to enter the template name. While the game is primarily played with the mouse, some keys are used as controls (w, a, s, d, space, delete). This creates the requirement of deciding when to take focus away from the text field. Some decisions are obvious (e.g. when the user presses the New Template button and the template is created) but others, not so much. For example, the user clicks the text field, then decides not to create a template.

While one option is to simply pop up a dialog and remove the text field from the main UI altogether, I was trying to avoid this. Does anyone have any thoughts on what would be a good trigger for taking focus away from the text field? Or do you think I should just drop the field and go with the dialog?

Main UI

share|improve this question
This might go better in User Experience. – user15805 Jan 7 '13 at 13:35
up vote 3 down vote accepted

I find it's typically best to go with what people expect.

In this situation I think the typical user would expect the text field to activate when clicked, take any keyboard input given (including the controls you use in game), then loose focus when the user clicked somewhere else or pressed enter to submit the changes.

If the user wanted to cancel the action, they could hit ESC or you can present a cancel button when the text field is active.

share|improve this answer
Agreed. When in doubt, mimic the default behaviour of the host OS. – Trevor Powell Jan 7 '13 at 18:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.