# G4P GKnob rotation direction

**URL:** https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299
**Category:** Libraries
**Created:** [April 30, 2020, 2:42pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299 "2020-04-30T14:42:49Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [April 30, 2020, 2:42pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/1 "2020-04-30T14:42:49Z")

</div>

When I use

`MyKnob.setTurnMode(GKnob.CTRL_VERTICAL);`

dragging the mouse up turns the knob anti-clockwise and the value decreases and vice versa when I drag down. I think it would be more ‘natural’ to have ‘drag up’ -\> rotate clockwise (increase value) and ‘drag down’ -\> rotate anti-clockwise (decrease value).

I haven’t been able to find any options to change this behaviour. Is it possible to do so?

Thanks Phil.

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [April 30, 2020, 4:19pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/2 "2020-04-30T16:19:39Z")

</div>

> [@PhilHaw](#):
>
> Is it possible to do so?

I have just checked and it is not possible.

Just out of interest I created a sketch with a GKnob and tried out the three modes, they all felt natural to me. I think it is a bit like the toggle switch, should the up position be power on or off, it depends on what your used to in your country.

Have you tried the other modes do they feel natural?

---

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [April 30, 2020, 4:30pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/3 "2020-04-30T16:30:56Z")

</div>

I have been using the horizontal mode and that feels _more_ natural as dragging right turns clockwise (increases value) etc. CTRL\_ANGULAR also works as I’d expect. I use a DAW for recording audio a lot and every plug-in that has knobs behaves the way I wish that CTRL\_VERTICAL did: drag up = clockwise (increase value). I suppose it’s just what I’ve been used to!

Anyway, thanks for looking.

Phil.

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [April 30, 2020, 5:03pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/4 "2020-04-30T17:03:50Z")

</div>

I hope to release a new version of G4P in a couple of weeks, please put a feature request on [Sourceforge](https://sourceforge.net/p/g4p/tickets/) and I will see what I can do. Perhaps include a reverse option 🤔

---

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [April 30, 2020, 6:00pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/5 "2020-04-30T18:00:08Z")

</div>

Thanks Peter. I have put in my request 🙂

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [May 1, 2020, 8:51am UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/6 "2020-05-01T08:51:30Z")

</div>

OK I have just looked at the source code and have found a better way to provide what you need rather than incorporate a reverse option.

The GKnob control has a sensitivity setting which controls how fast the knob turns for a given mouse movement. At the moment only positive values are accepted but I have modified the code to also accept negative values effectively reversing the direction for the CTRL\_VERTICAL and CTRL\_HORIZONTAL modes. So everyone is kept happy 😉

I have modified and tested the code so it will appear in the next release 4.3.5 which will probably be in a couple of weeks. 😀

---

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [May 1, 2020, 12:44pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/7 "2020-05-01T12:44:17Z")

</div>

Great Peter, many thanks. 👍 🙂

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [May 10, 2020, 3:16pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/8 "2020-05-10T15:16:27Z")

</div>

Processing 4.3.5 allows you to have negative sensitivitie effectively reversing the direction for the CTRL\_VERTICAL and CTRL\_HORIZONTAL modes.

It is now available for manual installation from [Sourceforge](https://sourceforge.net/projects/g4p/files/). Alternatively it will be available in Processing’s Contribution Manager in about 24 hours.

---

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [May 10, 2020, 9:18pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/9 "2020-05-10T21:18:00Z")

</div>

This is tops! 👍

Thanks for making this work Peter. The vertical option with -1 sensitivity feels so much more natural now. 👍

Phil.

---

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [May 18, 2020, 12:52pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/10 "2020-05-18T12:52:25Z")

</div>

Hi quark,

I’ve just found out that the OSX (Mac OS Sierra) version does not **reverse** when I use a negative sensitivity. In fact it just seems to **reduce** the sensitivity.

I’ve worked around it by using

` switch(platform) { case WINDOWS: MixKnob.setSensitivity(-1); break; case MACOSX: MixKnob.setSensitivity(1); break; }`

Just thought you might want to know about this Mac weirdness 🤔

Phil.

---

<div class="post-metadata">

### Author: ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)
#### Post date: [May 18, 2020, 4:53pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/11 "2020-05-18T16:53:20Z")

</div>

I have just tested the `G4P_KnobConfig` example that comes with the library on my iMac (OSX 10.14.6).

I added a line in setup

```auto
  kb = new GKnob(this, 60, 60, 180, 180, 0.8f);
  kb.setSensitivity(-1); // this line was added

```

and tried both +1 and -1 and it worked just fine. 🤔

---

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [May 18, 2020, 8:24pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/12 "2020-05-18T20:24:26Z")

</div>

Maybe I have forgotten to update the G4P library on my Mac Mini! 🤐

I probably have got confused by the ‘backwards’ scrolling in OSX compared to Windows, if you know what I mean 🤪

I will check it out and report back.

Phil

---

<div class="post-metadata">

### Author: ![PhilHaw](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/philhaw/32/8221_2.png) [@PhilHaw](https://discourse.processing.org/u/PhilHaw)
#### Post date: [May 18, 2020, 8:46pm UTC](https://discourse.processing.org/t/g4p-gknob-rotation-direction/20299/13 "2020-05-18T20:46:09Z")

</div>

Where’s the ‘red-faced’ emoticon!?! 🥺

My mistake for not updating the G4P Library on my Mac.

Peter thanks for checking and sorry to have troubled you.

Phil.
