dc := GetDC(0);
if (GetPixel(
dc,rect.Left + 146,rect.top + 155)= clwhite)
and (GetPixel(
dc,rect.Left + 174,rect.top + 155)= clwhite)
then begin
keybd_event(VK_down, MapVirtualKey(VK_down, 0), 0, 0);
keybd_event(VK_down, MapVirtualKey(VK_down, 0), KEYEVENTF_KEYUP, 0);
label1.Caption := '
DOWN';
end;
if (GetPixel(
dc,rect.Left + 149,rect.top + 130)= clwhite)
and (GetPixel(
dc,rect.Left + 149,rect.top + 158)= clwhite)
then begin
keybd_event(VK_LEFT, MapVirtualKey(VK_LEFT, 0), 0, 0);
keybd_event(VK_LEFT, MapVirtualKey(VK_LEFT, 0), KEYEVENTF_KEYUP, 0);
label1.Caption := '
LEFT';
end;
if (GetPixel(
dc,rect.Left + 146,rect.top + 133)= clwhite)
and (GetPixel(
dc,rect.Left + 174,rect.top + 133)= clwhite)
then begin
keybd_event(VK_UP, MapVirtualKey(VK_UP, 0), 0, 0);
keybd_event(VK_UP, MapVirtualKey(VK_UP, 0), KEYEVENTF_KEYUP, 0);
label1.Caption := '
UP';
end;
if (GetPixel(
dc,rect.Left + 171,rect.top + 130)= clwhite)
and (GetPixel(
dc,rect.Left + 171,rect.top + 158)= clwhite)
then begin
keybd_event(VK_RIGHT, MapVirtualKey(VK_RIGHT, 0), 0, 0);
keybd_event(VK_RIGHT, MapVirtualKey(VK_RIGHT, 0), KEYEVENTF_KEYUP, 0);
label1.Caption := '
RIGHT';
end;
ReleaseDC(0,
dc);