add game controller support

add game controller support and fix bugs.