It was Lewy Body Dementia. He had periods of lucidity and in one of those decided that he no longer wanted to live as a prisoner in his own body, and a burden to his family because for all intents and purposes his life as a functioning human was over.
Honestly his entire circumstance is a shining example of why we need a death with dignity law.
The assassination of Archduke Ferdinand which ignited WWI.