- case 1: /* requested async notifications */
- case 3: /* warnings ; command succeeded, but status is negative. */
+#ifdef DEBUG_XJCOM
+ else
+ printf("xjadeo: error '%s'\n", line.c_str());
+#endif
+ break;
+ case 3: /* async notifications */
+ {
+ std::string::size_type equalsign = line.find('=');
+ std::string::size_type comment = line.find('#');
+ if (comment != std::string::npos) { line = line.substr(0,comment); }
+ if (equalsign != std::string::npos) {
+ std::string key = line.substr(5, equalsign - 5);
+ std::string value = line.substr(equalsign + 1);
+
+ if (status == 310 && key=="keypress") {
+ /* keyboard event */
+ XJKeyEvent((unsigned int)atoi(value));
+ }
+#ifdef DEBUG_XJCOM
+ else {
+ std::string msg = line.substr(5);
+ printf("xjadeo: async '%s' -> '%s'\n", key, value);
+ }
+#endif
+ }
+#ifdef DEBUG_XJCOM
+ else {
+ std::string msg = line.substr(5);
+ printf("xjadeo: async '%s'\n", msg.c_str());
+ }
+#endif
+ } break;
+ case 1: /* text messages - command reply */
+ break;
+ case 8: /* comments / info for humans */