Mouse scrollwheel access?
Monkey Forums/Monkey Programming/Mouse scrollwheel access?
| ||
Am I blind? The docs reference MouseX and MouseY- How do I know the wheel is being used? |
| ||
Double check docs for MouseHit or MouseDown, I think you can at least check middle button input, not sure about scrolling though. |
| ||
Yeah I can check middle button. I guess worst case I can detect middle drag, but Ideally I need middle scroll. |
| ||
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! |
| ||
Cool. It's ok, I only need it for GLFW anyway, thanks, that's awesome! |
| ||
Hey Jim, do you mind if we add this to Diddy? |
| ||
Not at all. |
| ||
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() |
| ||
Just a heads up, Mousewheel in Diddy doesnt work in Firefox 15.0.1 /Stu |
| ||
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); } |