Mouse scrollwheel access?

Monkey Forums/Monkey Programming/Mouse scrollwheel access?

Cygnus(Posted 2012) [#1]
Am I blind? The docs reference MouseX and MouseY- How do I know the wheel is being used?


Dima(Posted 2012) [#2]
Double check docs for MouseHit or MouseDown, I think you can at least check middle button input, not sure about scrolling though.


Cygnus(Posted 2012) [#3]
Yeah I can check middle button. I guess worst case I can detect middle drag, but Ideally I need middle scroll.


invaderJim(Posted 2012) [#4]
I don't think mouse wheel is available because of inconsistencies with platforms (like mobile devices not having a mouse wheel) and with the actual values you get from the mouse wheel operations.

That being said, I've gutted out the mouse wheel functionality from my WIP input module, which you can download here and have at it, if you like.

Only supports HTML5, Flash, GLFW, and XNA.

I've included some sample code called wheeltest.monkey that you should be able to load up and run. Let me know if it works for ya!


Cygnus(Posted 2012) [#5]
Cool.

It's ok, I only need it for GLFW anyway, thanks, that's awesome!


therevills(Posted 2012) [#6]
Hey Jim, do you mind if we add this to Diddy?


invaderJim(Posted 2012) [#7]
Not at all.


therevills(Posted 2012) [#8]
Cheers Jim :)

I've altered the names a tad to be more inline with Monkey (/BlitzMax).
http://code.google.com/p/diddy/source/detail?r=473
MouseZ()



OvineByDesign(Posted 2012) [#9]
Just a heads up, Mousewheel in Diddy doesnt work in Firefox 15.0.1

/Stu


Carlo(Posted 2013) [#10]
function yimput_init() {
var canvas=document.getElementById( "GameCanvas" );

canvas.onmousewheel = function( e ) {
yim_mouseWheelDelta += e.wheelDelta/120.0;


}

canvas.addEventListener("DOMMouseScroll", function( e ) {
yim_mouseWheelDelta += -e.detail/3;


}, false);

}