python Tkinter focus_set() is not working properly on capturing key press event
focus_set
only affects events that fire after it is called, and it only affects keyboard events, not mouse clicks. Calling it in an event handler simply cannot effect the event being handled.