0

The only solution I can think of is to check which character is being pressed and then display that character on the screen. However, this strikes me as really tiresome and a generally poor solution. I can't think of another solution though. I thought about using the windows message loop instead of DirectInput, but I would still have to check on a character-by-character basis (unless I am misunderstanding something), so it seems like I would have the same problem.

Anyone have any ideas?

David
  • 207
  • 2
  • 3
  • 9

1 Answers1

0

You can create a few classes to assist you with this:

  • A "TextBuffer" that stores and provides typing operations on the currently edited string (including caret position etc).

  • A "TextPanel" or "TextWidget" which draws/displays a TextBuffer and recieves+forwards keypress messages when it has focus.

Encoding a concept of input "focus" in your UI can help simplify the control flow greatly.

Preet Kukreti
  • 8,417
  • 28
  • 36