The switch more or less happened when the Árpád dynasty died out with Andrew III, but the Hungarian succession rules were never set in stone. Even then though, the elections were more about electing a new ruling dynasty, not just the actual candidate. I think the election being centered solely around the individual can be attributed to Vladislaus I's election.
I did a bit of reading and i found that the situation was even more complicated than I thought:
1. In the Árpád era there were a lot of fighting for the throne partly because there was no law for succession. There was a tradition of "hereditary election" (sorry I have no idea how to correctly translate the term). The important part was that the ruler always had to come from the Árpád dynasty as long as there were any male Árpáds. But aside from that it was basically the strongest claimant getting the throne.
2. This continued more or less after the extinction of the Árpád dynasty with the addition of that if the male descendants of the first king of the new dynasty go extict the nobility can choose a new dynasty again. Thats why according to this after Ladislaus posthumus's death the Habsburg branch that had a legal claim to the throne of Hungary went extinct. That another branch of the house of Habsburg was elected later is another question.
So:
Sigismund was elected as king died without male heir.
Albert was elected as king had Ladislaus Posthumus.
Vladislaus I was elected - breaking the succession tradition of always choosing from the dynasty - but after his death his election was declared invalid and unlawful by the hungarian nobility who elected him in the first place. (reason for his election was political reality). Because of this he was not accpeted as dynasty founder.
Mathias was elected and died without male heir.
Vladislaus II was elected and had Louis II as an heir.
Louis II again died without an heir.
Than part of the nobility elected Ferdinand I and another part of the nobility elected John Zápolya.
There were various agreements between former hungarian kings that had promised for this situation the throne for the Habsburgs however these agreements were never made to law by the hungarian pairlaiment so they were not binding when electing a sucessor after a dynasty went extinct.
Its important to note that from the Habsburgs only the male descendants of Ferdinand I had right to the throne of Hungary after his 1527 election and in theory the hungarian pairlaiment could have choosen among them independently from who ruled in Vienna. This sucession tradition was codified as law in 1547. The other important part of this is that the spanish Hansburg had no right to the hungarian throne according to hungarian sucession laws.
What happened in 1687 when the nobility gave up its right to elect the king it gave up this right. From than on the theoretical possibility to elect as a king of Hungary a different male descendant of Ferdinand I than the one ruling in Vienna was eliminated.