I am trying to build a simple unit for basic commands without window based graphic, to do the first steps with my son without object orientaded stuff
I did it in Dos times also and I have my complete libraries with interupt handlers but I am sure XP is not as easy as DOS and Win 3.X, but the first problem is that there is no asm interface in lazarus.
Swithcing in the old Graphic mode:
{ We want an 8 bit mode }
gd := D8bit;
gm := m640x480;
initgraph(gd,gm,'');
{ Make sure you always check graphresult! }
error := graphResult;
if (error <> grOk) Then
begin
writeln('640x480x256 is not supported!');
halt(1)
end;
{ We are now in 640x480x256 }
_____________________________________________________________
opens two windows:
one text window and the graphic window
_________________________________________________________________
I tried to get the keystrokes and send it to the graphic window
No problem to get the keystrokes and send it to the screen, but it is not possible to do the inputs in the graphic window
I must use the text window to write the text.
Ok no problem for teaching but not very fine.
________________________________________________________________
function readGln(xpos,ypos:integer):string;
var K,hex:word;
xpos_intern : integer;
begin
xpos_intern := xpos;
Repeat
hex:=GetKeyEvent;
K:=TranslateKeyEvent(hex);
KeyEventToString(K);
if hex <> 7181
then
outTextXY(xpos_intern,ypos,GetKeyEventChar(K)); {output in graphic mode)
write(GetKeyEventChar(K)); {outout in textmode}
inc(xpos_intern,10);
Until hex=7181; {Return}
end;
.. the funciton is not ready ...