Skip to content

Commit 19c0be9

Browse files
committed
formatting
cleaned up using GFM
1 parent bc53cf0 commit 19c0be9

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
This is wyager's Proof-of-concept code for a Leap Motion-based mouse controller. It now works with both OS X and Windows.
1+
PyLeapMouse
2+
===========
3+
4+
wyager's Proof-of-concept code for a Leap Motion-based mouse controller. It now works with both OS X and Windows.
25

36
The most recent version is on Github at github.com/openleap/pyleapmouse.
47

5-
CONFIGURATION:
6-
1)Launch the Leap app (if not launched already) and plug in your Leap
7-
2)If you have not done so already, Configure your Leap screen from the Leap menu.
8-
3)WINDOWS USERS: You must copy all required library files (.libs and .dlls) from your Leap SDK folder to the "Windows" folder. These files are already included for OS X users, because OS X is 64-bit only.
9-
4)`cd` to the directory all this stuff is in and run `python PyLeapMouse.py` (minus quotes) or just double-click PyLeapMouse.py if you have your computer configured to launch .py files.
10-
5)Launch with the --palm argument to run in palm mode (with much more accurate two-handed control).
8+
###Configuration:
9+
1. Launch the Leap app (if not launched already) and plug in your Leap
10+
2. If you have not done so already, Configure your Leap screen from the Leap menu.
11+
3. WINDOWS USERS: You must copy all required library files (.libs and .dlls) from your Leap SDK folder to the "Windows" folder. These files are already included for OS X users, because OS X is 64-bit only.
12+
4. `cd` to the directory all this stuff is in and run `python PyLeapMouse.py` (minus quotes) or just double-click PyLeapMouse.py if you have your computer configured to launch .py files.
13+
5. Launch with the --palm argument to run in palm mode (with much more accurate two-handed control).
1114

12-
USAGE WITH FINGER MODE (python PyLeapMouse.py --finger) (default):
13-
Operation is as follows:
14-
1)Insert your hand into frame.
15-
2)The forwardmost finger that the program detects is the mouse finger. Where it points, the cursor goes.
16-
3)Stick your thumb out (see note) to click down, and fold your thumb in to click up.
17-
4)Using two pointer fingers (e.g. index and middle) goes into scroll mode, which is not very intuitive but shows how it might work. The fingertips must be within a short distance of each other to activate scroll mode.
15+
###Usage with Finger Mode (python PyLeapMouse.py --finger) (default):
16+
1. Insert your hand into frame.
17+
2. The forwardmost finger that the program detects is the mouse finger. Where it points, the cursor goes.
18+
3. Stick your thumb out (see note) to click down, and fold your thumb in to click up.
19+
4. Using two pointer fingers (e.g. index and middle) goes into scroll mode, which is not very intuitive but shows how it might work. The fingertips must be within a short distance of each other to activate scroll mode.
1820

19-
USAGE WITH PALM MODE (python PyLeapMouse.py --palm):
21+
###Usage with Palm Mode (python PyLeapMouse.py --palm):
2022
Operation is as follows:
2123
One hand in frame: The tilt of this hand moves the mouse.
2224
Two hands in frame: Left hand controls action.
@@ -25,8 +27,7 @@ Two hands in frame: Left hand controls action.
2527
Two fingers open: Scrolling. Scrolling with right hand movement.
2628
This is a somewhat unintuitive method of operation, but I find that it gives exceptionally better control than the most obvious "point-at-screen" method of mouse control. With this two-handed tilt based mode, it is easy to hit and properly engage small buttons, scroll through webpages, etc.
2729

28-
29-
NOTES:
30+
###Notes:
3031
This is a spare-time project, so it's not perfect quality. However, I tried to keep the code clean and readable. Let me know if you find any bugs (which there are certainly at least a few of). You can reach me at will (dot) yager (at) gmail (dot) (what the gmail domain ends in).
3132
The contents of the files are as follows:
3233
PyLeapMouse.py: The actual program
@@ -39,13 +40,13 @@ Geometry.py: Geometric functions
3940
MiscFunctions.py: Things that aren't strictly geometry and aren't specific to any interface style
4041
README.md: You are here
4142

42-
ADVANCED OPTIONS:
43+
###Advanced Options:
4344
`--smooth-aggressiveness [value]` sets the number of samples to use for pointer finger mouse smoothing.
4445
`--smooth-falloff [value]` sets the rate at which previous samples lose importance.
4546
For every sample back in time, the previous location of the mouse is weighted with weight smooth_falloff^(-#sample).
4647
So if smooth_falloff = 1.2, the current frame has weight 1/(1.2^0)=1, but the frame from 5 frames ago has weight 1/(1.2^5) = .4
4748
By default, the smooth aggressiveness is 8 frames with a falloff of 1.3.
4849

49-
TODO:
50+
###TODO:
5051
Add proper relative mouse movement. Should be pretty easy on Windows, not sure how to do so on OS X.
5152
Add multiple monitor support for absolute mouse mode (and OS X's pseudo-relative mode).

0 commit comments

Comments
 (0)