import java.util.logging.Level; import java.util.logging.Logger; import org.jnativehook.GlobalScreen; import org.jnativehook.NativeHookException; import org.jnativehook.mouse.NativeMouseWheelEvent; import org.jnativehook.mouse.NativeMouseWheelListener; import com.cycling74.max.Atom; import com.cycling74.max.MaxObject; public class globalMousewheel extends MaxObject implements NativeMouseWheelListener{ public globalMousewheel(Atom[] args) { //declareAttribute("autostart", null, "autoStart"); declareIO(1, 1); } @Override public void nativeMouseWheelMoved(NativeMouseWheelEvent e) { outlet(0, e.getWheelRotation()); } public void start(){ // Get the logger for "org.jnativehook" and set the level to warning. // Logger logger = Logger.getLogger(GlobalScreen.class.getPackage().getName()); // logger.setLevel(Level.WARNING); //no log message please final Logger logger = Logger.getLogger(GlobalScreen.class.getPackage().getName()); logger.setLevel(Level.OFF); //start NativeHook try { GlobalScreen.registerNativeHook(); } catch (NativeHookException ex) { post("There was a problem registering the native hook."); post(ex.getMessage()); } //start the listener GlobalScreen.addNativeMouseWheelListener(this); } public void stop(){ //stop the listener GlobalScreen.removeNativeMouseWheelListener(this); //Stop the nativeHook try { GlobalScreen.unregisterNativeHook(); } catch (NativeHookException ex) { post("There was a problem unregistering the native hook."); post(ex.getMessage()); } } }
Standard input is empty
Main.java:13: error: class globalMousewheel is public, should be declared in a file named globalMousewheel.java
public class globalMousewheel extends MaxObject implements NativeMouseWheelListener{
^
Main.java:4: error: package org.jnativehook does not exist
import org.jnativehook.GlobalScreen;
^
Main.java:5: error: package org.jnativehook does not exist
import org.jnativehook.NativeHookException;
^
Main.java:7: error: package org.jnativehook.mouse does not exist
import org.jnativehook.mouse.NativeMouseWheelEvent;
^
Main.java:8: error: package org.jnativehook.mouse does not exist
import org.jnativehook.mouse.NativeMouseWheelListener;
^
Main.java:10: error: package com.cycling74.max does not exist
import com.cycling74.max.Atom;
^
Main.java:11: error: package com.cycling74.max does not exist
import com.cycling74.max.MaxObject;
^
Main.java:13: error: cannot find symbol
public class globalMousewheel extends MaxObject implements NativeMouseWheelListener{
^
symbol: class MaxObject
Main.java:13: error: cannot find symbol
public class globalMousewheel extends MaxObject implements NativeMouseWheelListener{
^
symbol: class NativeMouseWheelListener
Main.java:15: error: cannot find symbol
public globalMousewheel(Atom[] args) {
^
symbol: class Atom
location: class globalMousewheel
Main.java:21: error: cannot find symbol
public void nativeMouseWheelMoved(NativeMouseWheelEvent e) {
^
symbol: class NativeMouseWheelEvent
location: class globalMousewheel
Main.java:17: error: cannot find symbol
declareIO(1, 1);
^
symbol: method declareIO(int,int)
location: class globalMousewheel
Main.java:20: error: method does not override or implement a method from a supertype
@Override
^
Main.java:32: error: cannot find symbol
final Logger logger = Logger.getLogger(GlobalScreen.class.getPackage().getName());
^
symbol: class GlobalScreen
location: class globalMousewheel
Main.java:37: error: cannot find symbol
GlobalScreen.registerNativeHook();
^
symbol: variable GlobalScreen
location: class globalMousewheel
Main.java:39: error: cannot find symbol
catch (NativeHookException ex) {
^
symbol: class NativeHookException
location: class globalMousewheel
Main.java:40: error: cannot find symbol
post("There was a problem registering the native hook.");
^
symbol: method post(String)
location: class globalMousewheel
Main.java:44: error: cannot find symbol
GlobalScreen.addNativeMouseWheelListener(this);
^
symbol: variable GlobalScreen
location: class globalMousewheel
Main.java:49: error: cannot find symbol
GlobalScreen.removeNativeMouseWheelListener(this);
^
symbol: variable GlobalScreen
location: class globalMousewheel
Main.java:52: error: cannot find symbol
GlobalScreen.unregisterNativeHook();
^
symbol: variable GlobalScreen
location: class globalMousewheel
Main.java:54: error: cannot find symbol
catch (NativeHookException ex) {
^
symbol: class NativeHookException
location: class globalMousewheel
Main.java:55: error: cannot find symbol
post("There was a problem unregistering the native hook.");
^
symbol: method post(String)
location: class globalMousewheel
22 errors
Standard output is empty