frame-focus

frame-focus is a built-in function in `C source code'.

(frame-focus &optional FRAME)

Return the frame to which FRAME's keystrokes are currently being sent.
If FRAME is omitted or nil, the selected frame is used.
Return nil if FRAME's focus is not redirected.
See `redirect-frame-focus'.