Make sure KeyCode is the last XML element here. Apparently the API requires elements in a certain order or it freaks out...