fixed key mapping o work based on the filetype, first approach has been wrong