Sensitivity value now between 0 and 255

This commit is contained in:
ailurux
2024-02-13 10:31:48 +11:00
parent 0426d245c8
commit 26ae027d67
5 changed files with 19 additions and 14 deletions
+5 -4
View File
@@ -260,14 +260,15 @@ function settings.input()
text = "Scroll Sensitivity",
}:add_style(theme.settings_title)
local slider_scale = 4; -- Power steering
local sensitivity = menu.content:Slider {
w = lvgl.PCT(100),
w = lvgl.PCT(90),
h = 5,
range = { min = 5, max = 45 },
value = controls.scroll_sensitivity:get(),
range = { min = 0, max = 255/slider_scale },
value = controls.scroll_sensitivity:get()/slider_scale,
}
sensitivity:onevent(lvgl.EVENT.VALUE_CHANGED, function()
controls.scroll_sensitivity:set(sensitivity:value())
controls.scroll_sensitivity:set(sensitivity:value()*slider_scale)
end)
return menu