Macro for Hotas

Is it allowed to use macro on Hotas that programmed to press flare/chaff key bind continuously when i hold it? i don’t use periodic as it dumps both cm (selected)