benkuper / Chataigne

Artist-friendly Modular Machine for Art and Technology
https://benjamin.kuperberg.fr/chataigne
GNU General Public License v3.0
1.11k stars 55 forks source link

Mouse scroll wheel support in the mouse module #221

Open thowilsee opened 4 months ago

thowilsee commented 4 months ago

Hello Ben,

I hope this message finds you well. I wanted to take a moment to express my appreciation for your excellent work on the software; I've been thoroughly enjoying using it.

However, there's one feature that I believe would greatly enhance its functionality for me. I'm keen on being able to control the mouse wheel using a MIDI controller. Do you think it would be possible to incorporate mouse wheel control into both the output and input of the mouse module?

Thank you once again for your dedication and hard work.

Best regards, Thomas

calebwest-SS commented 4 months ago

I also see the usefulness of this feature, and am currently working on adding it. I have the input side working, which is easier since it uses the Juce code to get all of the proper arguments from each operating system. image This is how I have it implemented - the amount of scroll is passed to the delta parameter, and the trigger is sent every time new data is received, so you can use that as an incrementor to add the data sent to some value, or to do something with the data field. That way there is no resetting of the delta necessary so the fields are displayed, and everything is less timing-dependent. Still open to feedback though. image This is the framework I have for the output command. I think it best to leave any repetition of the scroll action to the implementor and just send discrete commands, rather than have a toggle on or off. I'm hoping to be able to dig through the windows implementation soon, as that's my primary dev platform, and then move to mac and linux.

calebwest-SS commented 4 months ago

Working branch here: https://github.com/calebwest-SS/Chataigne/tree/MouseWheel

benkuper commented 4 months ago

seems nice ! please propose a PR so it can be added to the main code

calebwest-SS commented 4 months ago

Thanks! I will prep a PR to add it soon, still working through testing, I haven't been home to get my mac machine and a mouse with horizontal scroll, and want to test with a variety of mice to make sure things are good and proper.

I have the vertical scroll wheel input working on windows, but still need to test horizontal. Working through Mac documentation now.

calebwest-SS commented 4 months ago

@benkuper Just to check, mouse output is not currently supported for Linux at all?

benkuper commented 4 months ago

No it's not

benkuper commented 3 weeks ago

no news ?

benkuper commented 8 hours ago

@calebwest-SS did you make the PR ?