SliderLib:onFocus
since 1.6.2
Function called when the focus is changed.
Parameters
| Name |
Type |
Required |
Description |
handler |
function |
yes |
function(state) |
Returns
Nothing.
Examples
From the official Ethos documentationlocal line = form.addLine("Slider line")
local value = 10
local field = form.addSliderField(line, nil, 0, 100, function() return value end, function(newValue) value = newValue end)
field:onFocus(function(state) print("onFocus .. " .. state))