3
嘿,我使用D 1.041 with Tango 0.99.8,并想知道我将如何去移动鼠标和模拟键盘按下,并从屏幕上获取信息,例如特定坐标上的特定像素的颜色。我正在使用Windows。D 1.0(探戈)移动鼠标;模拟键盘按下等
任何帮助将不胜感激。我想用类似AutoIt的功能来编写一个基于类的库。例如:
mouse.move(100, 200);
mouse.click(2); // 2 = Middle Mouse Click
keyboard.type('abc');
import tango.sys.win32.UserGdi;
class Mouse{
alias SetCursorPos set_pos;
alias GetCursorPos get_pos;
void left_click(){
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0);
}
void right_click(){
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0);
}
}
此代码给我下面的错误:
Error 42: Symbol Undefined [email protected] --- errorlevel 1
上任何帮助吗?我仍在使用version。
这不是一个D特定的问题。尝试寻找基于C的解决方案;移植应该是直截了当的。 – FeepingCreature
请不要急于下结论。正如你在下面看到的,这是一个Tango特定的问题,因此它也是D专用的。 –