Extra mouse states (Mouse4, Mouse5, scroll wheel)
Monkey Forums/Monkey Code/Extra mouse states (Mouse4, Mouse5, scroll wheel)
| ||
Untested on XNA, sorry. If there's an error, it's because the enum can't be implicitly cast to Int. Would require a wrapper. Tested on current Desktop (glfw2) builds, works great. https://gist.github.com/nobuyukinyuu/8443525 |
| ||
If you want full mouse wheel code, I made it for all for all of the major targets after those major changes were made along with some other enhancements: https://bitbucket.org/Goodlookinguy/xaddon/src/default/mojohacks/native/ Also, neat idea with Mouse4/Mouse5. I assume these refer to the extra buttons on the mouse that typically move webpages forward and backwards. Edit: If you're interested in using my code, read this post. |
| ||
Scroll wheel is also in Diddy ;) |
| ||
Isn't your scroll wheel broken since it was based on old Monkey? |
| ||
LOL - I havent checked it in awhile, it might be ;) I actually want to remove a lot of the native code from Diddy - to much hassle to keep it up to date. But it goes to prove that this functionality is being added by multiple people so maybe (just maybe) it should be added to Monkey in the first place... |
| ||
@Goodlookinguy Nice work on getting scroll wheel to work on major targets. Mouse4/5 seem like they'd only really be useful on desktop targets anyway, but it's nice to have. So at least there's my code for that :) To note, for future reference: All of this scroll wheel code will likely have to be updated when glfw3 target is adopted, due to the changes in the way it's handled (goes from a persistent value to a delta value). Maybe inconsistencies in implementation is why it wasn't supported to begin with. |
| ||
To note, for future reference: All of this scroll wheel code will likely have to be updated when glfw3 target is adopted, due to the changes in the way it's handled (goes from a persistent value to a delta value). I'll keep that in mind. Maybe inconsistencies in implementation is why it wasn't supported to begin with. I suppose. Although I think Mark could have done the same thing that I did by dividing the values so that 1 scroll value = 1. Not these crazy 3 and 120 values that AS, C#, JS, and others give. |
| ||
@Goodlookinguy I'm quite interested by your mouse wheel functionnality. I attempt to use it for level editor the mouse scrolling change my object rotation. My problem is that i don't know how to implement your mojoplus.html5.js in my external javascript file. My knowledge about import extern javascript is based upon this post http://www.monkeycoder.co.nz/Community/posts.php?topic=120, which detailed only with functions use. So do i need to modify the code or is it possible to import a javascript variable directly in Monkey? Thanks in advance. |
| ||
See this: https://bitbucket.org/Goodlookinguy/xaddon/src/default/mojohacks/mojohacks.monkey That's the file where I import external functions from. And according to my files, you use it like this... |
| ||
Ok my apologies, in fact the functionnality of your framework are fully documented. |
| ||
@Goodlookingguy: Thank you for your mojohacks module. It has worked for me for weeks, but with current version (3) of glfw it does not work anymore, because glfwGetMouseWheel was removed from code. Any idea how to deal with this? |