added keyboard support for viewer