1) Stuffing chars into keyboard buffer, - Reply

new topic     » topic index » view thread      » older message » newer message

Neil Kube wrote:

> Has anybody written a routine which allows you to place characters into
> the keyboard buffer?

The following routine is perhaps marginally frendlier than Lee woo seob's
suggestion. Jiri

-- snip -------------------------------------------------
procedure clearkb()
   poke(#41C,peek(#41A))
end procedure

procedure stuffkb(sequence str)
   integer head,newtail,tail
   head=peek(#41A)
   tail=peek(#41C)
   for i=1 to length(str) do
      newtail=tail+2
      if newtail>60 then newtail=30 end if
      if newtail=head then
         exit
      else
         poke(1024+tail,str[i])
         tail=newtail
         poke(#41C,tail)
      end if
   end for
end procedure

stuffkb("dir /w\r\n")

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu