}
}
+void operator>>(const LexicalConverter &conv, MouseAxis &axis)
+{
+ if(conv.get()=="X")
+ axis = MOUSE_X_AXIS;
+ else if(conv.get()=="Y")
+ axis = MOUSE_Y_AXIS;
+ else
+ throw lexical_error(format("conversion of '%s' to MouseAxis", conv.get()));
+}
+
+void operator<<(LexicalConverter &conv, MouseAxis axis)
+{
+ switch(axis)
+ {
+ case MOUSE_X_AXIS: conv.result("X"); break;
+ case MOUSE_Y_AXIS: conv.result("Y"); break;
+ default: conv.result(format("MouseAxis(%#x)", static_cast<int>(axis)));
+ }
+}
+
+void operator>>(const LexicalConverter &conv, MouseButton &btn)
+{
+ if(conv.get()=="LEFT")
+ btn = MOUSE_LEFT;
+ else if(conv.get()=="MIDDLE")
+ btn = MOUSE_MIDDLE;
+ else if(conv.get()=="RIGHT")
+ btn = MOUSE_RIGHT;
+ else if(conv.get()=="WHEEL_UP")
+ btn = MOUSE_WHEEL_UP;
+ else if(conv.get()=="WHEEL_DOWN")
+ btn = MOUSE_WHEEL_DOWN;
+ else
+ throw lexical_error(format("conversion of '%s' to MouseButton", conv.get()));
+}
+
+void operator<<(LexicalConverter &conv, MouseButton btn)
+{
+ switch(btn)
+ {
+ case MOUSE_LEFT: conv.result("LEFT"); break;
+ case MOUSE_MIDDLE: conv.result("MIDDLE"); break;
+ case MOUSE_RIGHT: conv.result("RIGHT"); break;
+ case MOUSE_WHEEL_UP: conv.result("WHEEL_UP"); break;
+ case MOUSE_WHEEL_DOWN: conv.result("WHEEL_DOWN"); break;
+ default: conv.result(format("MouseButton(%#x)", static_cast<int>(btn)));
+ }
+}
+
} // namespace Input
} // namespace Msp