jhnsnc / precision-inputs

A highly customizable, accessible set of framework-agnostic input components for precision controls (knobs, dials, sliders, etc).
MIT License
51 stars 7 forks source link

Counter-intuitive drag behavior #13

Open jones1618 opened 6 years ago

jones1618 commented 6 years ago

The knob's a terrific control, beautifully packaged with great features and documentation but it took me quite a while to figure out the mouse drag behavior.

Intuitively I would have expected the knob to track the cursor around the knob. That is, when you start dragging the knob from 9:00 around to 12:00 and then to 3:00, you'd expect the knob's value to track at the same angle.

Honestly, I thought at first that the knobs were range limited or stuck. Instead, it took me some time to realize that the knob only tracks vertical movement, up to increase, down to decrease.

Suggestion: Provide an option to track mouse movement based on pointer's angle to the knob center.

jhnsnc commented 6 years ago

Thanks for the feedback! I'll definitely consider adding an option for mouse input by angle, especially if I hear similar feedback from others.

Part of my reason for starting this project is that all the knob components I found through googling used an angular input approach and I wanted something easier for precise input. I adopted an input pattern that I have seen in many desktop applications like DAWs (music-production software) where precision of input is critical, even with lots of similar input controls crammed in side by side.

In any case, I'll definitely wait until I complete a few wrapper components (e.g. https://github.com/jhnsnc/knob-input/issues/10) before extending the basic functionality with additional options. Perhaps I'll be able to get that done next weekend.

jones1618 commented 6 years ago

Would you consider a pull-request that implemented that feature (as an option) if I submitted one?

jhnsnc commented 6 years ago

Now that I have implemented FLStandardKnob ( #10 ), a wrapper class around KnobInput I would be open to someone working on this. (I wasn't confident that I had the structure of the KnobInput class right until I implement the first styled wrapper class.)

I would want it to be turned off by default because the KnobInput class may be used to implement vertical "slider" controls and the vertical drag interaction would be the expected interaction.

Perhaps we could call the option something like dragMode? Quick thoughts on possible values: