There is a way, but it's not 'easy' and it's not foolproof.
#constant USER32DLLNUMBER 200
function InitialiseUser32DLL()
load dll "user32.dll", USER32DLLNUMBER
endfunction
function ShutdownUser32DLL()
delete dll USER32DLLNUMBER
endfunction
function GetKeyName(Code as integer)
local Name as string
Name=space$(256)
if call dll(USER32DLLNUMBER, "GetKeyNameTextA", Code*65536, Name, len(Name)) = 0 then Name="Unknown"
endfunction Name
You use it like this:
` top of your program
InitialiseUser32DLL()
` Do this to get the name of the current scancode if you're lucky
key=scancode()
print GetKeyName(key)
` At the end of your program, release the dll
ShutdownUser32DLL()