Highly likely it's a bot and no it's not legal. Use of a manual or digital switch is legal (as it still requires a person activating the commands or in-game macros) but using a third party program like that with recorded key clicks isn't. Being as the intervals on those characters is precise I can say with certainty it's third party.