This complication is due to Unicode inheriting the Thai Industrial Standard 620, which worked in the same way, and was the way in which Thai had always been written on keyboards.
What standard did Unicode inherit involving a Thai language? 
Thai Industrial Standard 620