EmbAJAX icon indicating copy to clipboard operation
EmbAJAX copied to clipboard

EmbAJAXSlider only updating value when releasing mouse left-click

Open rhvarrier opened this issue 5 years ago • 1 comments

EmbAJAXSlider instance is only updating value when releasing mouse left-click. Is is possible to update its value instantaneously when moving the slider (same goes for the joystick)

rhvarrier avatar Jul 31 '20 21:07 rhvarrier

Same as #14 (and sorry for still not having an official solution).

Changing onChange to onInput on this line: https://github.com/tfry-git/EmbAJAX/blob/98cfc9b6f182df4e868b2cb21e75b4c89eb1f641/EmbAJAX.cpp#L248 should work as a quick-and-dirty solution.

tfry-git avatar Aug 04 '20 06:08 tfry-git

Hi,

I made an implementation which updates the values of the slider (and the color picker) each x ms when it has been changed. However, I am no sure what is the best way to change the API. Is backward compatibility necessary? My proposal is

EmbAJAXSlider::EmbAJAXSlider(const char* id, int16_t min, int16_t max, int16_t initial, int16_t update_min_interval_ms=0); EmbAJAXColorPicker::EmbAJAXColorPicker(const char* id, uint8_t r, uint8_t g, uint8_t b, int16_t _update_min_interval_ms=0);

a) When update_min_interval_ms equals zero (or when it is not specified) the functionality remains the same as today. This way, full reverse compatibility is guaranteed b) When a time interval is specified, it will update the value with minimum time between 2 updates, except for the last (release) update which comes undelayed

FedericoBusero avatar Feb 12 '23 12:02 FedericoBusero

Implemented it #43

tfry-git avatar Apr 24 '23 17:04 tfry-git