Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: TextEntered vs. KeyPressed  (Read 1413 times)

0 Members and 1 Guest are viewing this topic.

KageJittai

  • Newbie
  • *
  • Posts: 10
    • View Profile
TextEntered vs. KeyPressed
« on: March 15, 2011, 02:28:25 am »
I have a text box, when players enter text it will display.   I am having issues though as it seems that one key pressed will generate TWO events.

How can I determine which event I should listen to, and when.

Secondly, how can I flag the other events so it can be ignored further down the widget tree.

KageJittai

  • Newbie
  • *
  • Posts: 10
    • View Profile
TextEntered vs. KeyPressed
« Reply #1 on: March 15, 2011, 06:37:15 am »
NVM, I got it working... somehow

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
TextEntered vs. KeyPressed
« Reply #2 on: March 15, 2011, 11:33:25 pm »
For further reference. TextEvent is to handle typing much easier. It will handle the modifiers on the keys for you. Like shift and so. So a text event will give you a already formatted character when received.

At least that's my impression.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
TextEntered vs. KeyPressed
« Reply #3 on: March 15, 2011, 11:39:04 pm »
Quote from: "Groogy"
For further reference. TextEvent is to handle typing much easier. It will handle the modifiers on the keys for you. Like shift and so. So a text event will give you a already formatted character when received.

At least that's my impression.
It also allows unicode characters which might not be supported by KeyPressed
I use the latest build of SFML2