If I press and hold a certain key I get a constant stream if KeyInput events. However, each event's PressedDown boolean switches back and forth, rather than staying true until I release the key. For example, if I hold the "A" for 10 seconds, I'll get about 200 key press events, 100 of which are "up" and 100 of which are "down" (according to the PressedDown boolean).
Has anyone else experienced this before? I've include my "debugging" function as well, for good measure.
Code: Select all
std::ostream& operator<<(std::ostream& out, const SEvent& event) {
static std::string events[] = {
"EET_GUI_EVENT",
"EET_MOUSE_INPUT_EVENT",
"EET_KEY_INPUT_EVENT",
"EET_LOG_TEXT_EVENT",
"EET_USER_EVENT"
};
out << events[event.EventType];
if(event.EventType == EET_KEY_INPUT_EVENT) out
<< " {" << std::endl
<< " -> Char: " << event.KeyInput.Char << std::endl
<< " -> PressedDown: " << event.KeyInput.PressedDown << std::endl
<< " -> Shift: " << event.KeyInput.Shift << std::endl
<< " -> Control: " << event.KeyInput.Control << std::endl
<< " -> Key: " << event.KeyInput.Key << std::endl
<< "}"
;
return out;
}