И еще немного не по теме...Забил на модуль фонт32, выдающий ошибку, и начал разбираться с сенсорным дисплеем, получилась очень даже неплохая qwerty-клавиатура, которую я еще конечно буду доделывать под себя, но появился вопрос. Код слишком длинный и там очень много почти одинаковых строк можно ли его как-то оптимизировать?
Выкладываю код:
Program galaxy;
Uses
sensor;
Var
xcursor,ycursor,readkey:integer;
box:image;
key,text:string;
exit:boolean;
Begin
sensor.init;
box:=loadimage('/qwerty1.png');
drawimage(box,0,0);
repaint;
repeat
if pointer_state=1 then readkey:=1;
if (pointer_state=0) and (readkey=1) then readkey:=2
if readkey=2 then
begin
xcursor:=pointer_released_x;
ycursor:=pointer_released_y;
end;
if (xcursor>2) and (xcursor<33) and (ycursor>519) and (ycursor<544) and (readkey=2) then key:='q';
if (xcursor>38) and (xcursor<70) and (ycursor>519) and (ycursor<544) and (readkey=2) then key:='w';
if (xcursor>74) and (xcursor<105) and (ycursor>519) and (ycursor<544) and (readkey=2) then key:='e';
if (xcursor>110) and (xcursor<141) and (ycursor>519) and (ycursor<544) and (readkey=2) then key:='r';
if (xcursor>146) and (xcursor<177) and (ycursor>519) and (ycursor<544) and (readkey=2) then key:='t';
if (xcursor>182) and (xcursor<213) and (ycursor>519) and (ycursor<544) and (readkey=2) then key:='y';
if (xcursor>280) and (xcursor<329) and (ycursor>581) and (ycursor<605) and (readkey=2) then halt;
if readkey=2 then text:=text+key;
xcursor:=0;
ycursor:=0;
key:='';
if pointer_state=0 then readkey:=0;
drawtext(text,10,10);
repaint;
until (false)
End.