本文整理汇总了Java中org.jnativehook.mouse.NativeMouseEvent.getID方法的典型用法代码示例。如果您正苦于以下问题:Java NativeMouseEvent.getID方法的具体用法?Java NativeMouseEvent.getID怎么用?Java NativeMouseEvent.getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jnativehook.mouse.NativeMouseEvent
的用法示例。
在下文中一共展示了NativeMouseEvent.getID方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processButtonEvent
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
/**
* Processes native mouse button events by dispatching them to all registered
* <code>NativeMouseListener</code> objects.
*
* @param e the <code>NativeMouseEvent</code> to dispatch.
* @see NativeMouseEvent
* @see NativeMouseListener
* @see #addNativeMouseListener(NativeMouseListener)
*/
private void processButtonEvent(NativeMouseEvent e) {
NativeMouseListener[] listeners = eventListeners.getListeners(NativeMouseListener.class);
for (int i = 0; i < listeners.length; i++) {
switch (e.getID()) {
case NativeMouseEvent.NATIVE_MOUSE_CLICKED:
listeners[i].nativeMouseClicked(e);
break;
case NativeMouseEvent.NATIVE_MOUSE_PRESSED:
listeners[i].nativeMousePressed(e);
break;
case NativeMouseEvent.NATIVE_MOUSE_RELEASED:
listeners[i].nativeMouseReleased(e);
break;
}
}
}
示例2: processMouseEvent
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
/**
* Processes native mouse events by dispatching them to all registered
* <code>NativeMouseListener</code> objects.
*
* @param e the <code>NativeMouseEvent</code> to dispatch.
* @see NativeMouseEvent
* @see NativeMouseMotionListener
* @see #addNativeMouseMotionListener(NativeMouseMotionListener)
*/
private void processMouseEvent(NativeMouseEvent e) {
NativeMouseMotionListener[] listeners = eventListeners.getListeners(NativeMouseMotionListener.class);
for (int i = 0; i < listeners.length; i++) {
switch (e.getID()) {
case NativeMouseEvent.NATIVE_MOUSE_MOVED:
listeners[i].nativeMouseMoved(e);
break;
case NativeMouseEvent.NATIVE_MOUSE_DRAGGED:
listeners[i].nativeMouseDragged(e);
break;
}
}
}
示例3: nativeMouseClicked
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseClicked(NativeMouseEvent e) {
System.out.println("Received " + e.paramString());
if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_CLICKED) {
throw new IllegalArgumentException("Invalid event type received for nativeMouseClicked!");
}
lastEvent = e;
synchronized(this) {
this.notifyAll();
}
}
示例4: nativeMousePressed
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMousePressed(NativeMouseEvent e) {
System.out.println("Received " + e.paramString());
if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_PRESSED) {
throw new IllegalArgumentException("Invalid event type received for nativeKeyPressed!");
}
lastEvent = e;
synchronized(this) {
this.notifyAll();
}
}
示例5: nativeMouseReleased
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseReleased(NativeMouseEvent e) {
System.out.println("Received " + e.paramString());
if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_RELEASED) {
throw new IllegalArgumentException("Invalid event type received for nativeMouseReleased!");
}
lastEvent = e;
synchronized(this) {
this.notifyAll();
}
}
示例6: nativeMouseMoved
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseMoved(NativeMouseEvent e) {
System.out.println("Received " + e.paramString());
if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_MOVED) {
throw new IllegalArgumentException("Invalid event type received for nativeMouseMoved!");
}
lastEvent = e;
synchronized(this) {
this.notifyAll();
}
}
示例7: nativeMouseDragged
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
public void nativeMouseDragged(NativeMouseEvent e) {
System.out.println("Received " + e.paramString());
if (e.getID() != NativeMouseEvent.NATIVE_MOUSE_DRAGGED) {
throw new IllegalArgumentException("Invalid event type received" +
"" +
" for nativeMouseDragged!");
}
lastEvent = e;
synchronized(this) {
this.notifyAll();
}
}
示例8: processMouseEvent
import org.jnativehook.mouse.NativeMouseEvent; //导入方法依赖的package包/类
/**
* Processes native mouse events by dispatching them to all registered
* <code>NativeMouseListener</code> objects.
*
* @param e the <code>NativeMouseEvent</code> to dispatch.
* @see NativeMouseEvent
* @see NativeMouseListener
* @see #addNativeMouseListener(NativeMouseListener)
*/
protected void processMouseEvent(NativeMouseEvent e) {
int id = e.getID();
EventListener[] listeners;
if (id == NativeMouseEvent.NATIVE_MOUSE_MOVED || id == NativeMouseEvent.NATIVE_MOUSE_DRAGGED) {
listeners = eventListeners.getListeners(NativeMouseMotionListener.class);
}
else {
listeners = eventListeners.getListeners(NativeMouseListener.class);
}
for (int i = 0; i < listeners.length; i++) {
switch (id) {
case NativeMouseEvent.NATIVE_MOUSE_CLICKED:
((NativeMouseListener) listeners[i]).nativeMouseClicked(e);
break;
case NativeMouseEvent.NATIVE_MOUSE_PRESSED:
((NativeMouseListener) listeners[i]).nativeMousePressed(e);
break;
case NativeMouseEvent.NATIVE_MOUSE_RELEASED:
((NativeMouseListener) listeners[i]).nativeMouseReleased(e);
break;
case NativeMouseEvent.NATIVE_MOUSE_MOVED:
((NativeMouseMotionListener) listeners[i]).nativeMouseMoved(e);
break;
case NativeMouseEvent.NATIVE_MOUSE_DRAGGED:
((NativeMouseMotionListener) listeners[i]).nativeMouseDragged(e);
break;
}
}
}