1
Window / Recieving more than one Key at the same time?
« on: July 07, 2009, 04:05:15 am »
Thanks I'll definitely try that.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
I don't know what you mean by "Is it really a GUI system or just hardcoded stuff?" but the GUI_Manager, Button and Label classes could be used with any other SFML project just by copying the files and passing them the correct data when constructing them.
Quote from: "Sloped"I use a string because during testing I wanted to see different ways i could do different things, such as deleting an entered character and other such things. So when pressing Back it returns a string with the contents of "DEL", my input function takes this, finds the last character in the string and erases it.The "problem" of string in such a system is copying. You lose performance.Quote from: "Sloped"What are "flag"sI don't have any English tutor about that, sorry, but you can find them on Google with these keywords : bits flags C, I think.
Quote
Key events (KeyPressed, KeyReleased)
* Event.Key.Code contains the code of the key that was pressed / released
* Event.Key.Alt tells whether or not Alt key is pressed
* Event.Key.Control tells whether or not Control key is pressed
* Event.Key.Shift tells whether or not Shift key is pressed
I think you could use Event.Key.Shift to see if Shift is pressed with the key
Why don't you use TextEntered event??
The problem is that when key == sf::Key::A is true the function return so key == sf::Key::A && key == sf::Key::LShift is never tested.
You can use flag.
Here you use strings as return value. Why don't you use char ? Anyway, flag are the best here.
if(key == sf::Key::A) return "a";
if(key == sf::Key::A && key == sf::Key::LShift) return "A";