Today I wanted to make a small program to facilitate some tasks and I wrote this code:
Code: Select all
EndLoop = 0
do
Key = ""
Key = inkey
KeyCommand = 0
if multikey(&h1D) then
if multikey(&h52) then KeyCommand = 3
if multikey(&h53) then KeyCommand = 4
if multikey(&h1F) then KeyCommand = 2
Key = ""
end if
if Key = chr(27) then EndLoop = 1: Key = ""
if len(Key) > 0 and asc(Key) <> 255 then locate 10,1: MyString = MyString & Key: print MyString
if KeyCommand = 1 then locate 10,10: print space(len(MyString)): MyString = ""
if KeyCommand = 2 then locate 5,11: print space(20):locate 5,11: print "CTRL + S"
if KeyCommand = 3 then locate 5,11: print space(20):locate 5,11: print "CTRL + INS"
if KeyCommand = 4 then locate 5,11: print space(20):locate 5,11: print "CTRL + CANC"
sleep 1
loop until EndLoop > 0
But pressing the CTRL + INS or S or DEL keys Sometimes the message appears and sometimes nothing happens.
I need this code to create a management of the CTRL + KEY and ALT + KEY keys where they are not manageable with CHR ()
Have you ever had this kind of problem?
In any case, thank you for your attention