fix bugs
add keyboard support