the-deaf-king-alfonso

There was a tale that King Alfonso (Spain) was so deaf
that he hired a Spaniard for one unusual, but specific
task.
That task was to stand inconspicuously in front of the
King at ceremonial functions where the Spanish National
Anthem was to be played. The hired Spaniard would then
make a hidden gesture to alert the King to salute at
the right time.
Which King Alfonso was it? There was a number of
King Alfonsoes over the years in the Spanish kingdom.