I was reading through the lua scripting section and maybe I missed it, but I could not see how to determine which unit is currently selected, or if a group is selected, whichever one is prioritized for interaction (like the zero-k interface). I need to do this such that I may rebind keys in a script in luarules.
Please inform me of the corresponding function, or process.