Mouse wheel direction for switches

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Post Reply
Message
Author
Detlef
Posts: 311
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

Mouse wheel direction for switches

#1 Post by Detlef »

Hi,

I am not sure I am too late for the next Airmanager for Desktop release with this.

Maybe I overlook something. I cannot find a way to change the direction of the mouse wheel for switches. For example:
if I have a three-position switch and I rotate the mouse wheel, the switch callback sends +1 when turning the wheel down and -1 when turning the wheel up. How can I change that?

I tried:

mouse_setting(switch_id , "CLICK_ROTATE", -1)

to no effect.

Is the mouse_setting() function only for dials or can I use it to set the mouse behavior for multi position switches also? If not, it could be added as feature in the next release?!

Thank you
Detlef

User avatar
Ralph
Posts: 8360
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Mouse wheel direction for switches

#2 Post by Ralph »

Direction times -1?

Detlef
Posts: 311
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

Re: Mouse wheel direction for switches

#3 Post by Detlef »

Ralph wrote: Sun Jan 07, 2024 9:47 am Direction times -1?
Just using "direction times -1" did not work. I think the position value came out wrong in the callback function in that case.

Regards,
Detlef

User avatar
Ralph
Posts: 8360
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Mouse wheel direction for switches

#4 Post by Ralph »

Then I don't know what you mean...

User avatar
jph
Posts: 2866
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Mouse wheel direction for switches

#5 Post by jph »

Detlef wrote: Sun Jan 07, 2024 5:43 pm
Ralph wrote: Sun Jan 07, 2024 9:47 am Direction times -1?
Just using "direction times -1" did not work. I think the position value came out wrong in the callback function in that case.

Regards,
Detlef
Hi Detlef, he means that for each event you multiply the value returned by -1 so if the return is -1 then the result of -1 * -1 is a positive meaning 1, and if the value is 1, then multiplying by -1 will produce a negative meaning -1 in this case - hence reversing the sign of the values.
Regards
Joe
Joe. CISSP, MSc.

Detlef
Posts: 311
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

Re: Mouse wheel direction for switches

#6 Post by Detlef »

jph wrote: Mon Jan 08, 2024 6:46 am
Detlef wrote: Sun Jan 07, 2024 5:43 pm
Ralph wrote: Sun Jan 07, 2024 9:47 am Direction times -1?
Just using "direction times -1" did not work. I think the position value came out wrong in the callback function in that case.

Regards,
Detlef
Hi Detlef, he means that for each event you multiply the value returned by -1 so if the return is -1 then the result of -1 * -1 is a positive meaning 1, and if the value is 1, then multiplying by -1 will produce a negative meaning -1 in this case - hence reversing the sign of the values.
Regards
Joe
Hello Joe and @Ralph,

I understand you but you don't understand me :)

It is sometimes unbelievably complex to put simple things in words. So I figured it out now.
I (actually a friend of mine) wanted to use the position value from the switch callback function in an fs2020_variable_subsribe() directly as is.

The solution is, you put the pictures in reverse order in the switch_add() call and you do not use position but "2 minus position" in the fs2020_variable_subsribe() call.
Sounds simple but is some brain acrobatics. I thought a parameter in the switch_add() function could be used to the Airmanager functions to reverse the mouse wheel direction.

See my demo instrument
Generic - Mouse Scrollwheel Demo.siff
(9.05 KiB) Downloaded 235 times
Thanks
Detlef



image.png
image.png (11.25 KiB) Viewed 5355 times

SimPassion
Posts: 5676
Joined: Thu Jul 27, 2017 12:22 am

Re: Mouse wheel direction for switches

#7 Post by SimPassion »

Hi @Detlef, already made similar, though shouldn't be made through the call or subscription, but rather be handled in the callback function in any case ...

[EDITED]

Post Reply