fpc/packages/libndsfpc/examples/input/keyboard/keyboard_stdin/keyboardStdin.pp
Legolas 3f9327d340 * NDS: updated the rtl, libnds and fixed the examples. Now it should work fine with devkitARM r26
- Removed (again) old libgba examples

git-svn-id: trunk@13585 -
2009-08-23 13:57:45 +00:00

41 lines
574 B
ObjectPascal

program keyboardStdin;
{$mode objfpc}
uses
ctypes, nds9;
procedure OnKeyPressed(key: cint);
begin
if (key > 0) then
iprintf('%c', key);
end;
var
kbd: pKeyboard;
myName: array [0..255] of char;
begin
consoleDemoInit();
kbd := keyboardDemoInit();
kbd^.OnKeyPressed := @OnKeyPressed;
while true do
begin
iprintf('What is your name?'#10);
scanf('%s', myName);
iprintf(#10'Hello %s', myName);
scanKeys();
while (keysDown() = 0)do
scanKeys();
swiWaitForVBlank();
consoleClear();
end;
end.