I did this a while ago. I just removed the "bells and whistles" and should work the way it is. It works like a single or double click on a mouse.
START:
IF PORTA.1 = 1 Then START 'BUTTON NOT PUSHED STAY HERE
GoSub MOUSECLICK 'CHECK FOR DOUBLE CLICK
if click = 1 then let click = 0 : goto something
if click = 2 then let click = 0 : goto somethingelse
goto start
MOUSECLICK:
IF PORTA.1 = 0 Then MOUSECLICK 'stay here until switch is released
LET CLICK = CLICK + 1 'switch released
IF CLICK >=2 Then Return 'LIMIT CLICKS TO 2
pause 500 'switch has to be pushed 2 times within 1/2 second for double click
IF PORTA.1 = 0 Then MOUSECLICK 'switch pushed again
Return
Bookmarks