Skip to content
This repository has been archived by the owner on Jun 23, 2019. It is now read-only.

Commit

Permalink
Add support for vertical mouse wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
cgutman committed Sep 4, 2014
1 parent cbfe57e commit aaac318
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Binary file modified libs/limelight-common.jar
Binary file not shown.
1 change: 1 addition & 0 deletions src/com/limelight/gui/StreamFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public void build(Limelight limelight, NvConnection conn, StreamConfiguration st
renderingSurface.addKeyListener(keyboard);
renderingSurface.addMouseListener(mouse);
renderingSurface.addMouseMotionListener(mouse);
renderingSurface.addMouseWheelListener(mouse);
renderingSurface.setBackground(Color.BLACK);
renderingSurface.setIgnoreRepaint(true);
renderingSurface.setFocusable(true);
Expand Down
9 changes: 8 additions & 1 deletion src/com/limelight/input/MouseHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;

import javax.swing.SwingUtilities;

Expand All @@ -18,7 +20,7 @@
* Handles mouse input and sends them via the connection to the host
* @author Diego Waxemberg
*/
public class MouseHandler implements MouseListener, MouseMotionListener {
public class MouseHandler implements MouseListener, MouseMotionListener, MouseWheelListener {
private NvConnection conn;
private Robot robot;
private Dimension size;
Expand Down Expand Up @@ -239,4 +241,9 @@ private void moveMouse(int x, int y) {
lastY = y;
}

public void mouseWheelMoved(MouseWheelEvent event) {
conn.sendMouseScroll((byte) event.getWheelRotation());
event.consume();
}

}

0 comments on commit aaac318

Please sign in to comment.