void ejecutarComando(std::string &comando) { xdo_t * x = xdo_new(NULL); if (comando.substr(0, 4) == "type") { comando = comando.substr(5, comando.length()); xdo_enter_text_window(x, CURRENTWINDOW, comando.data(), 0); } else if (comando.substr(0, 5) == "click") { comando = comando.substr(6, comando.length()); int click = std::stoi(comando); xdo_click_window(x, CURRENTWINDOW, click); } else if (comando.substr(0, 9) == "mousemove") { comando = comando.substr(10, comando.length()); std::vector<std::string> coordenadas = split(comando); int x_mouse = std::stoi(coordenadas.at(0)); int y_mouse = std::stoi(coordenadas.at(1)); xdo_move_mouse(x, x_mouse, y_mouse, 0); } else { xdo_send_keysequence_window(x, CURRENTWINDOW, comando.c_str(), 0); } xdo_free(x); }
void XDO::keyType(const string& sequence) { xdo_send_keysequence_window(xdo_, CURRENTWINDOW, sequence.c_str(), 0); }