Can you make windows activate with task switcher?

When using Meta-Tab to switch between windows I would like to be able to press Meta-F4 to close the selected window.

Is there a way to set up task switcher so that the windows are active when selected with task switcher?

Or, is there another way to get the desired behavior?

Related – Close window (or other) shortcut to be effective from window switcher view KDE bug.