I'm trying to get the program to catch the SHIFT + KEY key combinations in the Linux terminal. For some reason, in about 10% of cases (randomly) when starting MULTIKEY does not work. Maybe I wrote the code wrong?
Code: Select all
dim as Zstring*5 key
dim as long iShift , iLeft , iRight
While Inkey <> "": Wend
do
if (multikey(&h36) or multikey(&h2A)) then ' SHIFT
iShift = 1
else
iShift = 0
EndIf
if multikey(&h4B) then ' LEFT
iLeft = 1
else
iLeft = 0
EndIf
if multikey(&h4D) then ' RIGHT
iRight = 1
else
iRight = 0
EndIf
if iShift andalso (iRight) then
? "SHIFT+RIGHT"
While Inkey <> "": Wend
sleep(200 , 1)
elseif iShift andalso (iLeft) then
? "SHIFT+LEFT"
While Inkey <> "": Wend
sleep(200 ,1)
else
key = inkey
if len(key) then
? *cast(short ptr , @key)
endif
EndIf
loop until key = chr(27)