Thanks Doug I didn't think of that (the button could be disabled like a slider between jumps), but unfortunately I tested and it is not that.
I have several cases of this problem but the one I'm looking onto here is on zSwatches, and part of the problem is that the button gets destroyed and recreated when the image changes (when you change a color in it). So of course it is not very regular but,
I finally found a good way to do it : I use the double edged button trick (found here) to differentiate click/shift-click, and in it I just added a check to see if the item pressed is this button and execute the code that normally would be inside the button declaration :
[Sleep,0.001,
[If,SleepResult==4,//waits for LButton down
[VarSet,keyOnMouseDown,[IGet,preferences:utilities:viewkeyboardstatus]]
]
[If,SleepResult==1024,//waits for interface pressed
[If, [IGetID, "ZPlugin:zYourPlugin:zYourButton"]==#sleepWinId),
[RoutineCall, goBtn]
]
]
[SleepAgain]
, 1024|4, sleepResult, sleepWinId]