improved keyhandling to include toplevel widget in search for target widget