add key handling and swap key binding to sample manager