Ported the CharacterDemo touch input code to C++.