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

Author Topic: Getting user input and displaying formatted text.  (Read 17920 times)

0 Members and 1 Guest are viewing this topic.

Raptor88

  • Full Member
  • ***
  • Posts: 111
    • View Profile
    • Email
Re: Getting user input and displaying formatted text.
« Reply #15 on: September 14, 2012, 09:57:15 am »
I'm not sure if it is standard. This code is "cleaner":

std::ifstream file("whatever.txt");
std::istream_iterator<char> begin(file);
std::istream_iterator<char> end;
std::string contents(begin, end);

Quote
- When looking for input, check which keys the user has pressed.
- Pass ASCII value of pressed keys to input class

No, watch the TextEntered event, not keys!

Thanks for the code and suggestions Laurent.
Raptor

Omegaclawe

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Getting user input and displaying formatted text.
« Reply #16 on: September 14, 2012, 10:30:57 pm »
Quote
- When looking for input, check which keys the user has pressed.
- Pass ASCII value of pressed keys to input class
No, watch the TextEntered event, not keys!

My implementation does, actually... mostly. It does watch the pressed keys for Up/down/left/right/delete, though. Backspace and return pass their own just fine, I think, but otherwise, the textentered event doesn't catch those keys... been a while since I looked at my implementation, though. :P

 

anything