Sub KU
key=GraphicsWindow.LastKey
key=Text.ConvertToLowerCase(key)
If key="leftshift" or key="rightshift" Then
shifted="False"
ElseIf key="back" then
key=""
pw=Text.GetSubText(pw,1,Text.GetLength(pw)-1)
cw=Text.GetSubTextToEnd(cw,2)
Else ' not shift or back
For i=1 To array.GetItemCount(dummy) 'shifted numpad (and space) : disregard
If key=dummy[i] then
key=""
i=99
EndIf
endfor
For i=1 To Array.GetItemCount(numspec) 'specialkeys numpad : translate
If key=numspec[i] Then
key=numkey[i]
i=99
EndIf
EndFor
If shifted="True" Then
If Text.StartsWith(key,"oem") then
For i=1 To Array.GetItemCount(oemspec)
If key="oem"+oemspec[i] then
key=oemkeyshift[i]
i=99
EndIf
EndFor
EndIf 'oem
If Text.GetLength(key)=2 And Text.StartsWith(key,"d") Then ' numberkeys on top
key=Text.GetSubTextToEnd(key,2)
key=Text.GetSubText(special,key+1,1)
EndIf
key=Text.ConvertToUpperCase(key)
Else ' not shifted
If Text.StartsWith(key,"oem") then
For i=1 To Array.GetItemCount(oemspec)
If key="oem"+oemspec[i] then
key=oemkey[i]
i=99
EndIf
EndFor
EndIf
If Text.GetLength(key)=2 And Text.StartsWith(key,"d") Then 'numberkeys on top
key=Text.GetSubTextToEnd(key,2)
ElseIf Text.StartsWith(key,"numpad") then 'numerical block of keys
key=Text.GetSubTextToEnd(key,7)
EndIf
EndIf 'shifted
If key<>"" then
pw=Text.Append(pw,key)
cw="*"+cw
endif
EndIf 'key = ....
GraphicsWindow.BrushColor="white"
GraphicsWindow.FillRectangle(50,31,248,28)
GraphicsWindow.FillRectangle(50,151,248,28)
GraphicsWindow.BrushColor="Blue"
GraphicsWindow.DrawText(50,35," "+cw)
GraphicsWindow.BrushColor="Orange"
GraphicsWindow.DrawText(50,150,pw)
key=""
EndSub
Sub KD
keyd=GraphicsWindow.LastKey
If keyd="LeftShift" or keyd= "RightShift" Then
shifted="True"
keyd=""
endif
EndSub