Lua Script: Return Cursor Focus To User-Choice

hi… would it be possible to make it so that lua scripts could return cursor focus to a specific place? for instance, ZynZilla & Genera Custom Wave, both retain the laptop keyboard in their window.
this means that there’s an extra click to get to the keyboard for keyjazzing purposes… wouldnt it be useful to be able to allow Lua scripts to have cursor focus, so that for instance after you click Generate, you can immediately keyjazz with the new sample?