Hi there. I know that ol.mousewheel doesn't work on the Mac anymore, but would like to let you know that I've tried it on Windows 7 (Pro 64) with Max 6.1.5 (32 bit) and it's working fine there...
On a related note, now I really need a solution on the Mac side... is there any cross-platform solution to get the mousewheel information? It's really unfortunate that such a basic and useful feature isn't supported by [mousestate] or other builtin object (with jit.window's exception). We can connect arduinos, kinects and wiimotes, but can't have access to the mousewheel or its additional buttons (and no, [hi] doesn't count, as the keyboard and mouse are not available on the Windows side...).
2) Compile the java source code in the following post. You will get a .class file.
3) Now you have to tell MAX/MSP where to find the jar file and the .class file . This means that you edit the "max.java.config.txt" file, adding the path to both files to this .txt file. This .txt file can be found in: "C:\Program Files\Cycling '74\Max 7\resources\packages\max-mxj\java-classes". Which lines to edit is described in the txt file itself.
4) Restart MAX/MSP
5) Create a mxj Object and enter"globalMousewheel" as its first argument. Send this object a "start" message" and it will output the mousewheel data.
After this put the jnativehook.jar in the lib folder of your eclipse project and add it to the java build path. (Google: eclipse add external jar to build path)
I think that the reason why you get the error messages is that you named the .java file something other than the class Name "globalMousewheel". In Java the classname has to be the same as the filename. Even if this is the case you will get further error mesages once you corrected this: Have a look at the "import" statements at the beginning of the code. Several classes that are stored in the max.jar and the nativehook.jar are imported. When compiling the code the compiler needs to know where to find this jar files. Thats the reason why you have to put them on the build path in Eclipse.
Please let me know how much java expierence you have got. If you have little or no java expierence i would post other, more detailed instructions.
my java experience is 0+, so I absolutely have to figure things out... and after few hours I could compile "something", please take a look at the attachment.
I've finished steps below:
1) Installed Ecliplse (eclipse-java-mars-2-macosx-cocoa-x86_64 and jdk-7u79-macosx-x64)
2) Made a new Java project with title "JNativeHook" (JavaSE-1.7 ex. enviroment)
3) Unpacked JNativeHook-2.0.3.zip and took only the jnativehook-2.0.3.jar from the package and putted in the "lib" folder of the relevant project's workspace
4) Added jitter.jar and max.jar from Max 6 dir in the same folder
5) Added those 3 files to the "Referenced Libraries" by "Add to Build Path" function in Eclipse
6) Made a new class file with name "globalMousewheel" in the "JNativeHook/src" source folder with modifiers "Public"
7) Pasted your script complete in the globalMousewheel.java tab of Eclipse and compiled the .class
8) added a line max.dynamic.class.dir /Users/itsprobablyme/Documents/workspace/JNativeHook/bin and max.dynamic.jar.dir /Users/itsprobablyme/Documents/workspace/JNativeHook/lib into the max.java.config.txt and safed the file.
9) restarted Max and added a new [mxj globalMousewheel]
One more thing: When you use the "globalMouswheel" object in a patch, make sure it has a "closebang" object with a message Object ("stop") connected to it. That way nativehhook will shut down when you close your patch, otherwise you will have a running ghost process in your system.