It is the part which can check the state of the hard key in iziBasic in real time.
It return a right result even if I continue pushing the key.
■PPコード
{KeyState 2007/6/19 Tuka}
{$code appl,FUWA,code,100} program Fuwafuwa;
{$i PalmAPI.pas}
{$i PPlib.pas}
type iBasFunType=function(S:string):string;
var iBasCallPP:iBasFunType;
C:integer;
W:Uint32;
S:string;
function CallPP(S:string):string;
begin
W:=KeyCurrentState;
S:='';
C:=0;
while C<=31 do
begin
if (W mod 2) = 0 then S:=S+'0' else S:=S+'1';
W:=W div 2;
C:=C+1;
end;
CallPP:=S;
end;
begin
iBasCallPP:=CallPP;
end.
It return a binary number form for the state of the key.
A key gives back "1" if pushed,"0" if not pushed.
If the first character is "1", a power key is pushed.
If the second character is "1", a page-up key is pushed.
If the twelfth character is "1", the back key to jog dial is pushed.
iziBasic code
"100" of CALLPP$(100) is resource ID.
If the first character is "1", this code substitutes -1 for E.(if a power key is pushed)
I can check the information of other keys equally, too.