scythe
scythe copied to clipboard
Add a function somewhere to force-focus an element
local finder = GUI.findElementByName("finder")
window.state.focusedElm = finder
-- Start the main loop
GUI.Main()
this snippet worked for me if anyone stumbles on this. it autofocuses an element on window start.
Update in case I ever get back to this:
Right now there's no way for an event handler to set the focus, only to lose it. This might just be a matter of:
-- window.lua @ window:updateInputEvents
if state.shouldLoseFocus then elementToLoseFocus = state.shouldLoseFocus end
+ if state.elementToFocus then elementToFocus = state.elementToFocus end