break;
case SDL_WINDOWEVENT_MOVED:
out << "moved, window ID: " << evt.windowID
break;
case SDL_WINDOWEVENT_MOVED:
out << "moved, window ID: " << evt.windowID
break;
case SDL_WINDOWEVENT_RESIZED:
out << "resized, window ID: " << evt.windowID
break;
case SDL_WINDOWEVENT_RESIZED:
out << "resized, window ID: " << evt.windowID
ostream &operator <<(ostream &out, const SDL_Keysym &keysym) {
out << "scancode: " << int(keysym.scancode)
ostream &operator <<(ostream &out, const SDL_Keysym &keysym) {
out << "scancode: " << int(keysym.scancode)
- << ", sym: " << int(keysym.sym);
- if (std::isprint(keysym.sym)) {
- out << " (\"" << char(keysym.sym) << "\")";
- }
+ << ", sym: " << int(keysym.sym)
+ << " (\"" << SDL_GetKeyName(keysym.sym) << "\")";
ostream &operator <<(ostream &out, const SDL_MouseMotionEvent &evt) {
out << "window ID: " << evt.windowID
<< ", mouse ID: " << evt.which
ostream &operator <<(ostream &out, const SDL_MouseMotionEvent &evt) {
out << "window ID: " << evt.windowID
<< ", mouse ID: " << evt.which
- << ", position: " << evt.x << '+' << evt.y
- << ", delta: " << evt.xrel << '+' << evt.yrel;
+ << ", position: " << evt.x << ' ' << evt.y
+ << ", delta: " << evt.xrel << ' ' << evt.yrel;
}
out << ", state: " << (evt.state == SDL_PRESSED ? "pressed" : "released")
<< ", clicks: " << int(evt.clicks)
}
out << ", state: " << (evt.state == SDL_PRESSED ? "pressed" : "released")
<< ", clicks: " << int(evt.clicks)
return out;
}
ostream &operator <<(ostream &out, const SDL_MouseWheelEvent &evt) {
out << "window ID: " << evt.windowID
<< ", mouse ID: " << evt.which
return out;
}
ostream &operator <<(ostream &out, const SDL_MouseWheelEvent &evt) {
out << "window ID: " << evt.windowID
<< ", mouse ID: " << evt.which
#if SDL_VERSION_ATLEAST(2, 0, 4)
<< ", direction: " << (evt.direction == SDL_MOUSEWHEEL_NORMAL ? "normal" : "flipped")
#endif
#if SDL_VERSION_ATLEAST(2, 0, 4)
<< ", direction: " << (evt.direction == SDL_MOUSEWHEEL_NORMAL ? "normal" : "flipped")
#endif
ostream &operator <<(ostream &out, const SDL_JoyBallEvent &evt) {
out << "joystick ID: " << evt.which
<< ", ball ID: " << int(evt.ball)
ostream &operator <<(ostream &out, const SDL_JoyBallEvent &evt) {
out << "joystick ID: " << evt.which
<< ", ball ID: " << int(evt.ball)