SFML community forums
Help => General => Topic started by: Razzeeyy on January 29, 2012, 02:27:09 pm
-
Hi guys, what am I doing wrong?
switch(Event.KeyEvent.Code)
{
case sf::Key::Code::Num1:
{
SelectedColor=Black;
break;
}
case sf::Key::Code::Num2:
{
SelectedColor=Blue;
break;
}
}
compiles with this error: invalid use of ‘struct sf::Event::KeyEvent’
The Event object is obviously sf::Event Event..
-
Event.KeyEvent.Code
This should be "Event.Key.Code".
KeyEvent is the name of the struct, while Key is defined like this:
KeyEvent Key;
-
Oh, yeah. Thank you! :)