Scrolling, mouse scope, icon
authorFrank Huang <me@nongraphical.com>
Mon, 30 Jul 2012 18:10:23 +0000 (11:10 -0700)
committerFrank Huang <me@nongraphical.com>
Mon, 30 Jul 2012 18:10:23 +0000 (11:10 -0700)
21 files changed:
Credits.rtf
English.lproj/MainMenu.xib
Enjoy.xcodeproj/project.pbxproj
Enjoy_Prefix.pch
JSActionAnalog.h
JSActionAnalog.m
JoystickController.h
JoystickController.m
README.md
Target.h
Target.m
TargetController.h
TargetController.m
TargetKeyboard.m
TargetMouseBtn.m
TargetMouseMove.m
TargetMouseScroll.h [new file with mode: 0644]
TargetMouseScroll.m [new file with mode: 0644]
TargetToggleMouseScope.h [new file with mode: 0644]
TargetToggleMouseScope.m [new file with mode: 0644]
icon.icns [new file with mode: 0644]

index d05d2324b7442b75940185d4420b55b3479826df..60f8d647cffc01f4d006ac15bc691dc72273f0ea 100644 (file)
@@ -1,8 +1,8 @@
-{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
+{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
 {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
 {\colortbl;\red255\green255\blue255;}
 \paperw11900\paperh16840\margl1440\margr1440\vieww9800\viewh11760\viewkind0
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural
 
 \f0\fs24 \cf0 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\
 \
@@ -10,4 +10,6 @@ The above copyright notice and this permission notice shall be included in\
 all copies or substantial portions of the Software.\
 \
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\
-}
\ No newline at end of file
+\
+\
+The joystick icon is from the Tango icon set and is public domain.}
\ No newline at end of file
index 60d948f4a031b43803fe78b4c6678ec06c736326..486e9db6fa40d0bc7b9afa7ac104b14c9f4c059c 100644 (file)
                                                                                                                        <int key="NSvFlags">256</int>
                                                                                                                        <string key="NSFrameSize">{242, 485}</string>
                                                                                                                        <reference key="NSSuperview" ref="698362889"/>
+                                                                                                                       <reference key="NSWindow"/>
                                                                                                                        <reference key="NSNextKeyView" ref="1036252745"/>
                                                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                                                        <object class="_NSCornerView" key="NSCornerView">
                                                                                                        </object>
                                                                                                        <string key="NSFrame">{{1, 1}, {242, 485}}</string>
                                                                                                        <reference key="NSSuperview" ref="364857164"/>
+                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="365506042"/>
                                                                                                        <reference key="NSDocView" ref="365506042"/>
                                                                                                        <reference key="NSBGColor" ref="834857663"/>
                                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                                        <string key="NSFrame">{{1, 1}, {8, 298}}</string>
                                                                                                        <reference key="NSSuperview" ref="364857164"/>
+                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="606740242"/>
                                                                                                        <reference key="NSTarget" ref="364857164"/>
                                                                                                        <string key="NSAction">_doScroller:</string>
                                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                                        <string key="NSFrame">{{-100, -100}, {473, 15}}</string>
                                                                                                        <reference key="NSSuperview" ref="364857164"/>
+                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="698362889"/>
                                                                                                        <int key="NSsFlags">1</int>
                                                                                                        <reference key="NSTarget" ref="364857164"/>
                                                                                        </object>
                                                                                        <string key="NSFrameSize">{244, 487}</string>
                                                                                        <reference key="NSSuperview" ref="977242492"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="892486973"/>
                                                                                        <int key="NSsFlags">133650</int>
                                                                                        <reference key="NSVScroller" ref="1036252745"/>
                                                                        </object>
                                                                        <string key="NSFrameSize">{244, 487}</string>
                                                                        <reference key="NSSuperview" ref="206489479"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="364857164"/>
                                                                        <string key="NSClassName">NSView</string>
                                                                </object>
                                                                        <int key="NSvFlags">256</int>
                                                                        <object class="NSMutableArray" key="NSSubviews">
                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
-                                                                               <object class="NSSegmentedControl" id="125828224">
+                                                                               <object class="NSSegmentedControl" id="875916470">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{227, 57}, {180, 24}}</string>
+                                                                                       <string key="NSFrame">{{227, 241}, {180, 24}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSNextKeyView"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="125828224"/>
                                                                                        <string key="NSReuseIdentifierKey">_NS:9</string>
                                                                                        <bool key="NSEnabled">YES</bool>
-                                                                                       <object class="NSSegmentedCell" key="NSCell" id="514491330">
+                                                                                       <object class="NSSegmentedCell" key="NSCell" id="241270212">
                                                                                                <int key="NSCellFlags">67239424</int>
                                                                                                <int key="NSCellFlags2">0</int>
-                                                                                               <object class="NSFont" key="NSSupport">
+                                                                                               <object class="NSFont" key="NSSupport" id="515740949">
                                                                                                        <string key="NSName">LucidaGrande</string>
                                                                                                        <double key="NSSize">13</double>
                                                                                                        <int key="NSfFlags">16</int>
                                                                                                </object>
                                                                                                <string key="NSCellIdentifier">_NS:9</string>
+                                                                                               <reference key="NSControlView" ref="875916470"/>
+                                                                                               <object class="NSMutableArray" key="NSSegmentImages">
+                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">87</double>
+                                                                                                               <string key="NSSegmentItemLabel">Horizontal</string>
+                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">86</double>
+                                                                                                               <string key="NSSegmentItemLabel">Vertical</string>
+                                                                                                               <int key="NSSegmentItemTag">1</int>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                               <int key="NSSegmentStyle">1</int>
+                                                                                       </object>
+                                                                               </object>
+                                                                               <object class="NSSegmentedControl" id="921829691">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">268</int>
+                                                                                       <string key="NSFrame">{{227, 137}, {180, 24}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSSegmentedCell" key="NSCell" id="301345285">
+                                                                                               <int key="NSCellFlags">67239424</int>
+                                                                                               <int key="NSCellFlags2">0</int>
+                                                                                               <reference key="NSSupport" ref="515740949"/>
+                                                                                               <string key="NSCellIdentifier">_NS:9</string>
+                                                                                               <reference key="NSControlView" ref="921829691"/>
+                                                                                               <object class="NSMutableArray" key="NSSegmentImages">
+                                                                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">87</double>
+                                                                                                               <string key="NSSegmentItemLabel">Up</string>
+                                                                                                               <bool key="NSSegmentItemSelected">YES</bool>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                                       <object class="NSSegmentItem">
+                                                                                                               <double key="NSSegmentItemWidth">86</double>
+                                                                                                               <string key="NSSegmentItemLabel">Down</string>
+                                                                                                               <int key="NSSegmentItemTag">1</int>
+                                                                                                               <int key="NSSegmentItemImageScaling">0</int>
+                                                                                                       </object>
+                                                                                               </object>
+                                                                                               <int key="NSSegmentStyle">1</int>
+                                                                                       </object>
+                                                                               </object>
+                                                                               <object class="NSSegmentedControl" id="125828224">
+                                                                                       <reference key="NSNextResponder" ref="606740242"/>
+                                                                                       <int key="NSvFlags">268</int>
+                                                                                       <string key="NSFrame">{{227, 189}, {180, 24}}</string>
+                                                                                       <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="921829691"/>
+                                                                                       <string key="NSReuseIdentifierKey">_NS:9</string>
+                                                                                       <bool key="NSEnabled">YES</bool>
+                                                                                       <object class="NSSegmentedCell" key="NSCell" id="514491330">
+                                                                                               <int key="NSCellFlags">67239424</int>
+                                                                                               <int key="NSCellFlags2">0</int>
+                                                                                               <reference key="NSSupport" ref="515740949"/>
+                                                                                               <string key="NSCellIdentifier">_NS:9</string>
                                                                                                <reference key="NSControlView" ref="125828224"/>
                                                                                                <object class="NSMutableArray" key="NSSegmentImages">
                                                                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                                                <object class="NSMatrix" id="120408205">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{20, 39}, {201, 388}}</string>
+                                                                                       <string key="NSFrame">{{20, 70}, {201, 369}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="719496628"/>
-                                                                                       <int key="NSNumRows">6</int>
+                                                                                       <int key="NSNumRows">7</int>
                                                                                        <int key="NSNumCols">1</int>
                                                                                        <object class="NSMutableArray" key="NSCells">
                                                                                                <bool key="EncodedWithXMLCoder">YES</bool>
@@ -1298,7 +1371,7 @@ ZSwgSW5jLiwgMjAwOQA</bytes>
                                                                                                <object class="NSButtonCell" id="820968178">
                                                                                                        <int key="NSCellFlags">604110336</int>
                                                                                                        <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Mouse X</string>
+                                                                                                       <string key="NSContents">Mouse movement</string>
                                                                                                        <reference key="NSSupport" ref="45863614"/>
                                                                                                        <reference key="NSControlView" ref="120408205"/>
                                                                                                        <int key="NSButtonFlags">1211912703</int>
@@ -1310,7 +1383,7 @@ ZSwgSW5jLiwgMjAwOQA</bytes>
                                                                                                <object class="NSButtonCell" id="275466816">
                                                                                                        <int key="NSCellFlags">604110336</int>
                                                                                                        <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Mouse Y</string>
+                                                                                                       <string key="NSContents">Mouse button</string>
                                                                                                        <reference key="NSSupport" ref="45863614"/>
                                                                                                        <reference key="NSControlView" ref="120408205"/>
                                                                                                        <int key="NSButtonFlags">1211912703</int>
@@ -1322,7 +1395,19 @@ ZSwgSW5jLiwgMjAwOQA</bytes>
                                                                                                <object class="NSButtonCell" id="134694197">
                                                                                                        <int key="NSCellFlags">604110336</int>
                                                                                                        <int key="NSCellFlags2">0</int>
-                                                                                                       <string key="NSContents">Mouse button</string>
+                                                                                                       <string key="NSContents">Mouse scroll</string>
+                                                                                                       <reference key="NSSupport" ref="45863614"/>
+                                                                                                       <reference key="NSControlView" ref="120408205"/>
+                                                                                                       <int key="NSButtonFlags">1211912703</int>
+                                                                                                       <int key="NSButtonFlags2">128</int>
+                                                                                                       <reference key="NSAlternateImage" ref="68833793"/>
+                                                                                                       <int key="NSPeriodicDelay">400</int>
+                                                                                                       <int key="NSPeriodicInterval">75</int>
+                                                                                               </object>
+                                                                                               <object class="NSButtonCell" id="211076068">
+                                                                                                       <int key="NSCellFlags">604110336</int>
+                                                                                                       <int key="NSCellFlags2">0</int>
+                                                                                                       <string key="NSContents">Toggle mouse scope</string>
                                                                                                        <reference key="NSSupport" ref="45863614"/>
                                                                                                        <reference key="NSControlView" ref="120408205"/>
                                                                                                        <int key="NSButtonFlags">1211912703</int>
@@ -1332,7 +1417,7 @@ ZSwgSW5jLiwgMjAwOQA</bytes>
                                                                                                        <int key="NSPeriodicInterval">75</int>
                                                                                                </object>
                                                                                        </object>
-                                                                                       <string key="NSCellSize">{201, 63}</string>
+                                                                                       <string key="NSCellSize">{201, 51}</string>
                                                                                        <string key="NSIntercellSpacing">{4, 2}</string>
                                                                                        <int key="NSMatrixFlags">1151868928</int>
                                                                                        <string key="NSCellClass">NSActionCell</string>
@@ -1413,6 +1498,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                                                        <int key="NSvFlags">2322</int>
                                                                                                                        <string key="NSFrameSize">{172, 14}</string>
                                                                                                                        <reference key="NSSuperview" ref="912477807"/>
+                                                                                                                       <reference key="NSWindow"/>
                                                                                                                        <reference key="NSNextKeyView" ref="194275224"/>
                                                                                                                        <object class="NSTextContainer" key="NSTextContainer" id="964782117">
                                                                                                                                <object class="NSLayoutManager" key="NSLayoutManager">
@@ -1490,11 +1576,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                                        </object>
                                                                                                        <string key="NSFrame">{{2, 2}, {172, 20}}</string>
                                                                                                        <reference key="NSSuperview" ref="719496628"/>
+                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="945527731"/>
                                                                                                        <reference key="NSDocView" ref="945527731"/>
                                                                                                        <reference key="NSBGColor" ref="214000480"/>
                                                                                                        <object class="NSCursor" key="NSCursor">
-                                                                                                               <string key="NSHotSpot">{1, -1}</string>
+                                                                                                               <string key="NSHotSpot">{5, 5}</string>
                                                                                                                <int key="NSCursorType">0</int>
                                                                                                        </object>
                                                                                                        <int key="NScvFlags">4</int>
@@ -1504,6 +1591,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                                        <string key="NSFrame">{{-100, -100}, {15, 133}}</string>
                                                                                                        <reference key="NSSuperview" ref="719496628"/>
+                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="725849905"/>
                                                                                                        <reference key="NSTarget" ref="719496628"/>
                                                                                                        <string key="NSAction">_doScroller:</string>
@@ -1514,6 +1602,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                                        <int key="NSvFlags">-2147483392</int>
                                                                                                        <string key="NSFrame">{{-100, -100}, {87, 18}}</string>
                                                                                                        <reference key="NSSuperview" ref="719496628"/>
+                                                                                                       <reference key="NSWindow"/>
                                                                                                        <reference key="NSNextKeyView" ref="912477807"/>
                                                                                                        <int key="NSsFlags">1</int>
                                                                                                        <reference key="NSTarget" ref="719496628"/>
@@ -1522,8 +1611,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                                        <double key="NSPercent">0.94565220000000005</double>
                                                                                                </object>
                                                                                        </object>
-                                                                                       <string key="NSFrame">{{229, 318}, {176, 24}}</string>
+                                                                                       <string key="NSFrame">{{229, 350}, {176, 24}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="605541128"/>
                                                                                        <int key="NSsFlags">133123</int>
                                                                                        <reference key="NSVScroller" ref="605541128"/>
@@ -1533,9 +1623,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                <object class="NSPopUpButton" id="194275224">
                                                                                        <reference key="NSNextResponder" ref="606740242"/>
                                                                                        <int key="NSvFlags">268</int>
-                                                                                       <string key="NSFrame">{{226, 251}, {182, 26}}</string>
+                                                                                       <string key="NSFrame">{{226, 293}, {182, 26}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
-                                                                                       <reference key="NSNextKeyView" ref="125828224"/>
+                                                                                       <reference key="NSWindow"/>
+                                                                                       <reference key="NSNextKeyView" ref="875916470"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSPopUpButtonCell" key="NSCell" id="74311158">
                                                                                                <int key="NSCellFlags">-1539178944</int>
@@ -1568,6 +1659,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                        <int key="NSvFlags">268</int>
                                                                                        <string key="NSFrame">{{5, 456}, {507, 17}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="497528019"/>
                                                                                        <bool key="NSEnabled">YES</bool>
                                                                                        <object class="NSTextFieldCell" key="NSCell" id="853503577">
@@ -1590,6 +1682,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                                        <int key="NSvFlags">12</int>
                                                                                        <string key="NSFrame">{{12, 445}, {493, 5}}</string>
                                                                                        <reference key="NSSuperview" ref="606740242"/>
+                                                                                       <reference key="NSWindow"/>
                                                                                        <reference key="NSNextKeyView" ref="120408205"/>
                                                                                        <string key="NSOffsets">{0, 0}</string>
                                                                                        <object class="NSTextFieldCell" key="NSTitleCell">
@@ -1616,26 +1709,29 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                                        </object>
                                                                        <string key="NSFrame">{{253, 0}, {517, 487}}</string>
                                                                        <reference key="NSSuperview" ref="206489479"/>
+                                                                       <reference key="NSWindow"/>
                                                                        <reference key="NSNextKeyView" ref="1016088174"/>
                                                                        <string key="NSClassName">NSView</string>
                                                                </object>
                                                        </object>
                                                        <string key="NSFrameSize">{770, 487}</string>
                                                        <reference key="NSSuperview" ref="177223957"/>
+                                                       <reference key="NSWindow"/>
                                                        <reference key="NSNextKeyView" ref="977242492"/>
                                                        <bool key="NSIsVertical">YES</bool>
                                                </object>
                                        </object>
                                        <string key="NSFrameSize">{770, 487}</string>
                                        <reference key="NSSuperview"/>
+                                       <reference key="NSWindow"/>
                                        <reference key="NSNextKeyView" ref="206489479"/>
                                </object>
-                               <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
+                               <string key="NSScreenRect">{{0, 0}, {1600, 1178}}</string>
                                <string key="NSMaxSize">{10000000000000, 10000000000000}</string>
                                <bool key="NSWindowIsRestorable">YES</bool>
                        </object>
                        <object class="NSCustomView" id="671181514">
-                               <reference key="NSNextResponder"/>
+                               <nil key="NSNextResponder"/>
                                <int key="NSvFlags">256</int>
                                <object class="NSMutableArray" key="NSSubviews">
                                        <bool key="EncodedWithXMLCoder">YES</bool>
@@ -1777,7 +1873,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                <int key="NSvFlags">260</int>
                                                <string key="NSFrame">{{57, 4}, {39, 28}}</string>
                                                <reference key="NSSuperview" ref="671181514"/>
-                                               <reference key="NSNextKeyView"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSButtonCell" key="NSCell" id="1008023024">
                                                        <int key="NSCellFlags">604110336</int>
@@ -1799,7 +1894,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                        </object>
                                </object>
                                <string key="NSFrameSize">{322, 454}</string>
-                               <reference key="NSSuperview"/>
                                <reference key="NSNextKeyView" ref="443618264"/>
                                <string key="NSClassName">NSView</string>
                        </object>
@@ -2398,6 +2492,38 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                        </object>
                                        <int key="connectionID">747</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">scrollDirSelect</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="921829691"/>
+                                       </object>
+                                       <int key="connectionID">751</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">sdirChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="921829691"/>
+                                       </object>
+                                       <int key="connectionID">752</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">mouseDirSelect</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="875916470"/>
+                                       </object>
+                                       <int key="connectionID">756</int>
+                               </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBActionConnection" key="connection">
+                                               <string key="label">mdirChanged:</string>
+                                               <reference key="source" ref="801536542"/>
+                                               <reference key="destination" ref="875916470"/>
+                                       </object>
+                                       <int key="connectionID">757</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
@@ -3124,6 +3250,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                        <reference ref="719496628"/>
                                                        <reference ref="194275224"/>
                                                        <reference ref="125828224"/>
+                                                       <reference ref="921829691"/>
+                                                       <reference ref="875916470"/>
                                                </object>
                                                <reference key="parent" ref="206489479"/>
                                        </object>
@@ -3170,6 +3298,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                        <reference ref="820968178"/>
                                                        <reference ref="275466816"/>
                                                        <reference ref="134694197"/>
+                                                       <reference ref="211076068"/>
                                                </object>
                                                <reference key="parent" ref="606740242"/>
                                        </object>
@@ -3272,6 +3401,39 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                                <reference key="object" ref="514491330"/>
                                                <reference key="parent" ref="125828224"/>
                                        </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">748</int>
+                                               <reference key="object" ref="211076068"/>
+                                               <reference key="parent" ref="120408205"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">749</int>
+                                               <reference key="object" ref="921829691"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="301345285"/>
+                                               </object>
+                                               <reference key="parent" ref="606740242"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">750</int>
+                                               <reference key="object" ref="301345285"/>
+                                               <reference key="parent" ref="921829691"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">754</int>
+                                               <reference key="object" ref="875916470"/>
+                                               <object class="NSMutableArray" key="children">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <reference ref="241270212"/>
+                                               </object>
+                                               <reference key="parent" ref="606740242"/>
+                                       </object>
+                                       <object class="IBObjectRecord">
+                                               <int key="objectID">755</int>
+                                               <reference key="object" ref="241270212"/>
+                                               <reference key="parent" ref="875916470"/>
+                                       </object>
                                </object>
                        </object>
                        <object class="NSMutableDictionary" key="flattenedProperties">
@@ -3401,6 +3563,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                        <string>744.IBPluginDependency</string>
                                        <string>745.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey</string>
                                        <string>745.IBPluginDependency</string>
+                                       <string>748.IBPluginDependency</string>
+                                       <string>749.IBPluginDependency</string>
+                                       <string>750.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey</string>
+                                       <string>750.IBPluginDependency</string>
+                                       <string>754.IBPluginDependency</string>
+                                       <string>755.IBNSSegmentedControlInspectorSelectedSegmentMetadataKey</string>
+                                       <string>755.IBPluginDependency</string>
                                        <string>81.IBPluginDependency</string>
                                        <string>83.IBPluginDependency</string>
                                        <string>92.IBPluginDependency</string>
@@ -3532,6 +3701,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <integer value="0"/>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <integer value="1"/>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+                                       <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                </object>
                        </object>
@@ -3547,15 +3723,445 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
                                <reference key="dict.values" ref="0"/>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">747</int>
+                       <int key="maxID">757</int>
+               </object>
+               <object class="IBClassDescriber" key="IBDocument.Classes">
+                       <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+                               <bool key="EncodedWithXMLCoder">YES</bool>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">ApplicationController</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <string key="NS.key.0">toggleActivity:</string>
+                                               <string key="NS.object.0">id</string>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <string key="NS.key.0">toggleActivity:</string>
+                                               <object class="IBActionInfo" key="NS.object.0">
+                                                       <string key="name">toggleActivity:</string>
+                                                       <string key="candidateClassName">id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>activeButton</string>
+                                                       <string>activeMenuItem</string>
+                                                       <string>configsController</string>
+                                                       <string>dockMenuBase</string>
+                                                       <string>drawer</string>
+                                                       <string>jsController</string>
+                                                       <string>mainWindow</string>
+                                                       <string>targetController</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>NSToolbarItem</string>
+                                                       <string>NSMenuItem</string>
+                                                       <string>ConfigsController</string>
+                                                       <string>NSMenu</string>
+                                                       <string>NSDrawer</string>
+                                                       <string>JoystickController</string>
+                                                       <string>NSWindow</string>
+                                                       <string>TargetController</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>activeButton</string>
+                                                       <string>activeMenuItem</string>
+                                                       <string>configsController</string>
+                                                       <string>dockMenuBase</string>
+                                                       <string>drawer</string>
+                                                       <string>jsController</string>
+                                                       <string>mainWindow</string>
+                                                       <string>targetController</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">activeButton</string>
+                                                               <string key="candidateClassName">NSToolbarItem</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">activeMenuItem</string>
+                                                               <string key="candidateClassName">NSMenuItem</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">configsController</string>
+                                                               <string key="candidateClassName">ConfigsController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">dockMenuBase</string>
+                                                               <string key="candidateClassName">NSMenu</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">drawer</string>
+                                                               <string key="candidateClassName">NSDrawer</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">jsController</string>
+                                                               <string key="candidateClassName">JoystickController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">mainWindow</string>
+                                                               <string key="candidateClassName">NSWindow</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">targetController</string>
+                                                               <string key="candidateClassName">TargetController</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/ApplicationController.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">ConfigsController</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>addPressed:</string>
+                                                       <string>removePressed:</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>addPressed:</string>
+                                                       <string>removePressed:</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">addPressed:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">removePressed:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>removeButton</string>
+                                                       <string>tableView</string>
+                                                       <string>targetController</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>NSButton</string>
+                                                       <string>NSTableView</string>
+                                                       <string>TargetController</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>removeButton</string>
+                                                       <string>tableView</string>
+                                                       <string>targetController</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">removeButton</string>
+                                                               <string key="candidateClassName">NSButton</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">tableView</string>
+                                                               <string key="candidateClassName">NSTableView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">targetController</string>
+                                                               <string key="candidateClassName">TargetController</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/ConfigsController.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">JoystickController</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>configsController</string>
+                                                       <string>outlineView</string>
+                                                       <string>targetController</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>ConfigsController</string>
+                                                       <string>NSOutlineView</string>
+                                                       <string>TargetController</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>configsController</string>
+                                                       <string>outlineView</string>
+                                                       <string>targetController</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">configsController</string>
+                                                               <string key="candidateClassName">ConfigsController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">outlineView</string>
+                                                               <string key="candidateClassName">NSOutlineView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">targetController</string>
+                                                               <string key="candidateClassName">TargetController</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/JoystickController.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">KeyInputTextView</string>
+                                       <string key="superclassName">NSTextView</string>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>targetController</string>
+                                                       <string>window</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>TargetController</string>
+                                                       <string>NSWindow</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>targetController</string>
+                                                       <string>window</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">targetController</string>
+                                                               <string key="candidateClassName">TargetController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">window</string>
+                                                               <string key="candidateClassName">NSWindow</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/KeyInputTextView.h</string>
+                                       </object>
+                               </object>
+                               <object class="IBPartialClassDescription">
+                                       <string key="className">TargetController</string>
+                                       <string key="superclassName">NSObject</string>
+                                       <object class="NSMutableDictionary" key="actions">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>configChosen:</string>
+                                                       <string>mbtnChanged:</string>
+                                                       <string>mdirChanged:</string>
+                                                       <string>radioChanged:</string>
+                                                       <string>sdirChanged:</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                                       <string>id</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="actionInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>configChosen:</string>
+                                                       <string>mbtnChanged:</string>
+                                                       <string>mdirChanged:</string>
+                                                       <string>radioChanged:</string>
+                                                       <string>sdirChanged:</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">configChosen:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">mbtnChanged:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">mdirChanged:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">radioChanged:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                                       <object class="IBActionInfo">
+                                                               <string key="name">sdirChanged:</string>
+                                                               <string key="candidateClassName">id</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="outlets">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>configPopup</string>
+                                                       <string>configsController</string>
+                                                       <string>joystickController</string>
+                                                       <string>keyInput</string>
+                                                       <string>mouseBtnSelect</string>
+                                                       <string>mouseDirSelect</string>
+                                                       <string>radioButtons</string>
+                                                       <string>radioConfig</string>
+                                                       <string>radioKey</string>
+                                                       <string>radioNoAction</string>
+                                                       <string>scrollDirSelect</string>
+                                                       <string>title</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>NSPopUpButton</string>
+                                                       <string>ConfigsController</string>
+                                                       <string>JoystickController</string>
+                                                       <string>KeyInputTextView</string>
+                                                       <string>NSSegmentedControl</string>
+                                                       <string>NSSegmentedControl</string>
+                                                       <string>NSMatrix</string>
+                                                       <string>NSButtonCell</string>
+                                                       <string>NSButtonCell</string>
+                                                       <string>NSButtonCell</string>
+                                                       <string>NSSegmentedControl</string>
+                                                       <string>NSTextField</string>
+                                               </object>
+                                       </object>
+                                       <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+                                               <bool key="EncodedWithXMLCoder">YES</bool>
+                                               <object class="NSArray" key="dict.sortedKeys">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <string>configPopup</string>
+                                                       <string>configsController</string>
+                                                       <string>joystickController</string>
+                                                       <string>keyInput</string>
+                                                       <string>mouseBtnSelect</string>
+                                                       <string>mouseDirSelect</string>
+                                                       <string>radioButtons</string>
+                                                       <string>radioConfig</string>
+                                                       <string>radioKey</string>
+                                                       <string>radioNoAction</string>
+                                                       <string>scrollDirSelect</string>
+                                                       <string>title</string>
+                                               </object>
+                                               <object class="NSArray" key="dict.values">
+                                                       <bool key="EncodedWithXMLCoder">YES</bool>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">configPopup</string>
+                                                               <string key="candidateClassName">NSPopUpButton</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">configsController</string>
+                                                               <string key="candidateClassName">ConfigsController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">joystickController</string>
+                                                               <string key="candidateClassName">JoystickController</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">keyInput</string>
+                                                               <string key="candidateClassName">KeyInputTextView</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">mouseBtnSelect</string>
+                                                               <string key="candidateClassName">NSSegmentedControl</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">mouseDirSelect</string>
+                                                               <string key="candidateClassName">NSSegmentedControl</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">radioButtons</string>
+                                                               <string key="candidateClassName">NSMatrix</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">radioConfig</string>
+                                                               <string key="candidateClassName">NSButtonCell</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">radioKey</string>
+                                                               <string key="candidateClassName">NSButtonCell</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">radioNoAction</string>
+                                                               <string key="candidateClassName">NSButtonCell</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">scrollDirSelect</string>
+                                                               <string key="candidateClassName">NSSegmentedControl</string>
+                                                       </object>
+                                                       <object class="IBToOneOutletInfo">
+                                                               <string key="name">title</string>
+                                                               <string key="candidateClassName">NSTextField</string>
+                                                       </object>
+                                               </object>
+                                       </object>
+                                       <object class="IBClassDescriptionSource" key="sourceIdentifier">
+                                               <string key="majorKey">IBProjectSource</string>
+                                               <string key="minorKey">./Classes/TargetController.h</string>
+                                       </object>
+                               </object>
+                       </object>
                </object>
-               <object class="IBClassDescriber" key="IBDocument.Classes"/>
                <int key="IBDocument.localizationMode">0</int>
                <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
                        <integer value="1050" key="NS.object.0"/>
                </object>
+               <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+                       <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+                       <real value="1060" key="NS.object.0"/>
+               </object>
                <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
                        <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
                        <integer value="3000" key="NS.object.0"/>
index 44084e7aaa66ee573cadf7aab8d203aea430106e..8892e8650ce5a5ce3ae16d6a3f85c2a19c0dcdfc 100644 (file)
@@ -10,6 +10,8 @@
                1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; };
                8B7E476C15C314A200C588FA /* TargetMouseBtn.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B7E476B15C314A200C588FA /* TargetMouseBtn.m */; };
                8BD9B54315C230FF00929C5D /* TargetMouseMove.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BD9B54215C230FE00929C5D /* TargetMouseMove.m */; };
+               8BEFAD9C15C46BFF00823AEC /* TargetMouseScroll.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BEFAD9B15C46BFF00823AEC /* TargetMouseScroll.m */; };
+               8BEFADA015C476DC00823AEC /* TargetToggleMouseScope.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BEFAD9F15C476DC00823AEC /* TargetToggleMouseScope.m */; };
                8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
                8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
                8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
                8B7E476B15C314A200C588FA /* TargetMouseBtn.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TargetMouseBtn.m; sourceTree = "<group>"; };
                8BD9B54115C230FE00929C5D /* TargetMouseMove.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetMouseMove.h; sourceTree = "<group>"; };
                8BD9B54215C230FE00929C5D /* TargetMouseMove.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TargetMouseMove.m; sourceTree = "<group>"; };
+               8BEFAD9A15C46BFF00823AEC /* TargetMouseScroll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetMouseScroll.h; sourceTree = "<group>"; };
+               8BEFAD9B15C46BFF00823AEC /* TargetMouseScroll.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TargetMouseScroll.m; sourceTree = "<group>"; };
+               8BEFAD9E15C476DC00823AEC /* TargetToggleMouseScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetToggleMouseScope.h; sourceTree = "<group>"; };
+               8BEFAD9F15C476DC00823AEC /* TargetToggleMouseScope.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TargetToggleMouseScope.m; sourceTree = "<group>"; };
                8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
                8D1107320486CEB800E47090 /* Enjoy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Enjoy.app; sourceTree = BUILT_PRODUCTS_DIR; };
                D549CA4B0FBB441B00BC8203 /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Credits.rtf; sourceTree = "<group>"; };
                                8BD9B54215C230FE00929C5D /* TargetMouseMove.m */,
                                8B7E476A15C314A200C588FA /* TargetMouseBtn.h */,
                                8B7E476B15C314A200C588FA /* TargetMouseBtn.m */,
+                               8BEFAD9A15C46BFF00823AEC /* TargetMouseScroll.h */,
+                               8BEFAD9B15C46BFF00823AEC /* TargetMouseScroll.m */,
+                               8BEFAD9E15C476DC00823AEC /* TargetToggleMouseScope.h */,
+                               8BEFAD9F15C476DC00823AEC /* TargetToggleMouseScope.m */,
                        );
                        name = Classes;
                        sourceTree = "<group>";
                                D5F809710FB093400006A4DE /* TargetConfig.m in Sources */,
                                8BD9B54315C230FF00929C5D /* TargetMouseMove.m in Sources */,
                                8B7E476C15C314A200C588FA /* TargetMouseBtn.m in Sources */,
+                               8BEFAD9C15C46BFF00823AEC /* TargetMouseScroll.m in Sources */,
+                               8BEFADA015C476DC00823AEC /* TargetToggleMouseScope.m in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index b915d20909a0b1ce6117637eb642b2c397df53cc..0fab5019bbf383e2bbc282c4c8c0dff25f8b90b8 100644 (file)
@@ -24,4 +24,6 @@
 #import "TargetController.h"
 #import "TargetKeyboard.h"
 #import "TargetMouseMove.h"
-#import "TargetMouseBtn.h"
\ No newline at end of file
+#import "TargetMouseBtn.h"
+#import "TargetMouseScroll.h"
+#import "TargetToggleMouseScope.h"
\ No newline at end of file
index 50875820a955986ebfb36779fd423014f68feba5..f1276d509df3ddfc685c4df75b5b193714770b92 100644 (file)
@@ -16,4 +16,7 @@
 @property(readwrite) double offset;
 @property(readwrite) double scale;
 
+- (id) initWithIndex: (int)newIndex;
+-(double) getRealValue: (int) value;
+
 @end
index a1c57e8533c2668737b265a9cc1902471ed939e5..e35199613cabfd2fe2e8d43319ad71b41137a0e8 100644 (file)
@@ -30,7 +30,7 @@
     //Target* target = [[base->configsController currentConfig] getTargetForAction: [subActions objectAtIndex: 0]];
     
        int raw = IOHIDValueGetIntegerValue(value);
-       double parsed = offset + scale * raw;
+    double parsed = [self getRealValue: raw];
        
        if(parsed < -0.3) // fixed?!
                return [subActions objectAtIndex: 0];
     [[subActions objectAtIndex: 2] setActive: true];
     
        int raw = IOHIDValueGetIntegerValue(value);
-       double parsed = offset + scale * raw;
+    double parsed = [self getRealValue: raw];
        
        [[subActions objectAtIndex: 0] setActive: (parsed < -0.3)];
        [[subActions objectAtIndex: 1] setActive: (parsed > 0.3)];
 }
 
+-(double) getRealValue: (int)value {
+       double parsed = offset + scale * value;
+    return parsed;
+}
+
 @synthesize offset, scale;
 
 
index 4c878f254d0a0142bebd21031e0ef936415e62d9..aa95815bdd92b6cf8990422a14d2c5c7793411b6 100644 (file)
 
 @interface JoystickController : NSObject {
        NSMutableArray *joysticks;
+    NSMutableArray *runningTargets;
        IOHIDManagerRef hidManager;
        IBOutlet NSOutlineView* outlineView;
        IBOutlet TargetController* targetController;
        IBOutlet ConfigsController* configsController;
        id selectedAction;
        BOOL programmaticallySelecting;
+    BOOL frontWindowOnly;
+    
+    @public
+    NSPoint mouseLoc;
 }
 
 -(void) setup;
@@ -28,5 +33,7 @@
 
 @property(readonly) id selectedAction;
 @property(readonly) NSMutableArray *joysticks;
+@property(readonly) NSMutableArray *runningTargets;
+@property(readwrite) BOOL frontWindowOnly;
 
 @end
index b510848f89bea27c42d2f4712392be06803055ef..976b531a01c89c61081fa84b2e97b4c6d94a8de3 100644 (file)
@@ -5,14 +5,18 @@
 //  Created by Sam McCall on 4/05/09.
 //
 
+#import "CoreFoundation/CoreFoundation.h"
+
 @implementation JoystickController
 
-@synthesize joysticks, selectedAction;
+@synthesize joysticks, runningTargets, selectedAction, frontWindowOnly;
 
 -(id) init {
        if(self=[super init]) {
                joysticks = [[NSMutableArray alloc]init];
+        runningTargets = [[NSMutableArray alloc]init];
                programmaticallySelecting = NO;
+        mouseLoc.x = mouseLoc.y = 0;
        }
        return self;
 }
@@ -40,6 +44,22 @@ static NSMutableDictionary* create_criterion( UInt32 inUsagePage, UInt32 inUsage
        [outlineView expandItem: handler];
 }
 
+BOOL objInArray(NSMutableArray *array, id object) {
+    for (id o in array) {
+        if (o == object)
+            return true;
+    }
+    return false;
+}
+
+void timer_callback(CFRunLoopTimerRef timer, void *ctx) {
+    JoystickController *jc = (JoystickController *)ctx;
+    jc->mouseLoc = [NSEvent mouseLocation];
+    for (Target *target in [jc runningTargets]) {
+        [target update: jc];
+    }
+}
+
 void input_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDValueRef value) {
        JoystickController* self = (JoystickController*)inContext;
        IOHIDDeviceRef device = IOHIDQueueGetDevice((IOHIDQueueRef) inSender);
@@ -61,8 +81,27 @@ void input_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDVal
                                continue;
                        /* target application? doesn't seem to be any need since we are only active when it's in front */
                        /* might be required for some strange actions */
-                       [target setRunning: [subaction active]];
-            [target setInputValue: IOHIDValueGetIntegerValue(value)];
+            if ([target running] != [subaction active]) {
+                if ([subaction active]) {
+                    [target trigger: self];
+                }
+                else {
+                    [target untrigger: self];
+                }
+                [target setRunning: [subaction active]];
+            }
+            
+            if ([mainAction isKindOfClass: [JSActionAnalog class]]) {
+                double realValue = [(JSActionAnalog*)mainAction getRealValue: IOHIDValueGetIntegerValue(value)];
+                [target setInputValue: realValue];
+            
+                // Add to list of running targets
+                if ([target isContinuous] && [target running]) {
+                    if (!objInArray([self runningTargets], target)) {
+                        [[self runningTargets] addObject: target];
+                    }
+                }
+            }
                }
        } else if([[NSApplication sharedApplication] isActive] && [[[NSApplication sharedApplication]mainWindow]isVisible]) {
                // joysticks not active, use it to select stuff
@@ -134,11 +173,11 @@ void remove_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDe
                 create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_Joystick),
                 create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_GamePad),
          create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_MultiAxisController),
-         create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard),
+         //create_criterion(kHIDPage_GenericDesktop, kHIDUsage_GD_Keyboard),
        nil];
        
        IOHIDManagerSetDeviceMatchingMultiple(hidManager, (CFArrayRef)criteria);
-       
+    
        IOHIDManagerScheduleWithRunLoop( hidManager, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode );
        IOReturn tIOReturn = IOHIDManagerOpen( hidManager, kIOHIDOptionsTypeNone );
        (void)tIOReturn;
@@ -147,6 +186,17 @@ void remove_callback(void* inContext, IOReturn inResult, void* inSender, IOHIDDe
        IOHIDManagerRegisterDeviceRemovalCallback(hidManager, remove_callback, (void*) self);
 //     IOHIDManagerRegisterInputValueCallback(hidManager, input_callback, (void*)self);
 // register individually so we can find the device more easily
+    
+    
+       
+    // Setup timer for continuous targets
+    CFRunLoopTimerContext ctx = {
+        0, (void*)self, NULL, NULL, NULL
+    };
+    CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault,
+                                                   CFAbsoluteTimeGetCurrent(), 1.0/80.0,
+                                                   0, 0, timer_callback, &ctx);
+    CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopDefaultMode);
 }
 
 -(id) determineSelectedAction {
index daf4ed673ee33c1cb6471052e6f3a3f8a3f30c8c..2a7c478dc6be9d5f2d616e76611ad3373f847aca 100644 (file)
--- a/README.md
+++ b/README.md
@@ -8,11 +8,21 @@ If you've ever played a video game which only supports mouse and keyboard input,
 * Key events
 * Mouse clicks
 * Mouse movement (for analog sticks)
+* Scrolling
 
 Enjoy2 supports multiple configurations (for different games or programs) and you can even map joystick buttons to change configurations on-the-fly.
 
 Enjoy2 is written by [Yifeng Huang](htty://nongraphical.com) and is based on [Enjoy by Sam McCall](http://abstractable.net/enjoy/). Enjoy is MIT-licensed.
 
+## How to use
+
+At startup, and when Enjoy2 is paused, press any button or move any analog stick to jump to the configuration for that button or stick. From there, select one of the mapping options from the choices on the right.
+
+To use an analog axis to move the mouse, select the "Analog" sub-item on the left.
+
+### Mapping modes
+
+Enjoy2 offers two mouse mapping modes: global and single-window. Enjoy2 starts in global mode, but you can set any joystick button to the "toggle mouse scope" action, which will change the mode. If you are using Enjoy2 to play a video game, you may find that one or the other mode offers better compatibility with your game's specific requirements.
 
 ## Requirements
 
@@ -25,4 +35,6 @@ Version 1.1
 
 * Forked from Enjoy
 * Mouse movement support
-* Mouse button support
\ No newline at end of file
+* Mouse button support
+* Scrollwheel support
+* Support for two mouse movement modes
index 215245ffd6d4b3ceec1d53e990de6161d47cf953..43b7d0c10fa3a345c657afadecf70f1a45d08f6e 100644 (file)
--- a/Target.h
+++ b/Target.h
 
 @interface Target : NSObject {
        BOOL running;
-    int inputValue;
+    BOOL isContinuous;
+    double inputValue;
 }
 
 @property(readwrite) BOOL running;
-@property(readwrite) int inputValue;
--(void) trigger;
--(void) untrigger;
+@property(readonly) BOOL isContinuous;
+@property(readwrite) double inputValue;
+-(void) trigger: (JoystickController *)jc;
+-(void) untrigger: (JoystickController *)jc;
+-(void) update: (JoystickController *)jc;
 -(NSString*) stringify;
 +(Target*) unstringify: (NSString*) str withConfigList: (NSArray*) configs;
 
index 35ebfc2dfef16c8bb0189c518987657c6a045c15..ec2d6a16462c5b5f1701f97143e45ff017d5ee9b 100644 (file)
--- a/Target.m
+++ b/Target.m
         return [TargetMouseMove unstringifyImpl:components];
     if([typeTag isEqualToString:@"mbtn"])
         return [TargetMouseBtn unstringifyImpl:components];
+    if([typeTag isEqualToString:@"mscroll"])
+        return [TargetMouseScroll unstringifyImpl:components];
+    if([typeTag isEqualToString:@"mtoggle"])
+        return [TargetToggleMouseScope unstringifyImpl:components];
                
        NSParameterAssert(NO);
        return NULL;
        return NULL;
 }
 
--(void) trigger {
+-(void) trigger: (JoystickController *)jc {
        [self doesNotRecognizeSelector:_cmd];
 }
 
--(void) untrigger {
+-(void) untrigger: (JoystickController *)jc {
        // no-op by default
 }
 
--(BOOL) running {
-       return running;
+-(void) update: (JoystickController *) jc {
+    [self doesNotRecognizeSelector:_cmd];
 }
--(void) setRunning: (BOOL) newRunning {
-       if(newRunning == running)
-               return;
-       if(newRunning)
-               [self trigger];
-       else
-               [self untrigger];
-       running = newRunning;           
+
+-(BOOL) isContinuous {
+    return false;
 }
 
-@synthesize inputValue;
+@synthesize inputValue, running;
 
 @end
index f68a6da5d001188ae646958727f4d24f8b24cc6b..2d499b7472e392cf732ea636210b183383f3cf07 100644 (file)
@@ -18,7 +18,9 @@
        IBOutlet KeyInputTextView* keyInput;
        IBOutlet NSButtonCell *radioNoAction, *radioKey, *radioConfig;
        IBOutlet NSMatrix* radioButtons;
+    IBOutlet NSSegmentedControl* mouseDirSelect;
     IBOutlet NSSegmentedControl* mouseBtnSelect;
+    IBOutlet NSSegmentedControl* scrollDirSelect;
        IBOutlet NSTextField* title;
        IBOutlet NSPopUpButton* configPopup;
        IBOutlet ConfigsController* configsController;
@@ -34,7 +36,9 @@
 -(void) refreshConfigsPreservingSelection: (BOOL) preserve;
 -(IBAction)configChosen:(id)sender;
 -(IBAction)radioChanged:(id)sender;
+-(IBAction)mdirChanged:(id)sender;
 -(IBAction)mbtnChanged:(id)sender;
+-(IBAction)sdirChanged:(id)sender;
 -(void) focusKey;
 
 @property(readwrite) BOOL enabled;
index 9b075a15945ca851b8f5aa679d42952738cbd7ac..3442a61e3912169d45437683405bcff8e7f9ad24 100644 (file)
        [[[NSApplication sharedApplication] mainWindow] makeFirstResponder: sender];
        [self commit];
 }
+-(IBAction)mdirChanged:(id)sender {
+    [radioButtons setState: 1 atRow: 3 column: 0];
+       [[[NSApplication sharedApplication] mainWindow] makeFirstResponder: sender];
+       [self commit];
+}
 -(IBAction)mbtnChanged:(id)sender {
+    [radioButtons setState: 1 atRow: 4 column: 0];
+       [[[NSApplication sharedApplication] mainWindow] makeFirstResponder: sender];
+       [self commit];
+}
+-(IBAction)sdirChanged:(id)sender {
     [radioButtons setState: 1 atRow: 5 column: 0];
        [[[NSApplication sharedApplication] mainWindow] makeFirstResponder: sender];
        [self commit];
                        return c;
                }
         case 3: {
-            // mouse X
+            // mouse X/Y
             TargetMouseMove *mm = [[TargetMouseMove alloc] init];
-            [mm setDir: 0];
+            [mm setDir: [mouseDirSelect selectedSegment]];
             return mm;
         }
         case 4: {
-            // mouse Y
-            TargetMouseMove *mm = [[TargetMouseMove alloc] init];
-            [mm setDir: 1];
-            return mm;
-        }
-        case 5: {
             // mouse button
             TargetMouseBtn *mb = [[TargetMouseBtn alloc] init];
             if ([mouseBtnSelect selectedSegment] == 0) {
             }
             return mb;
         }
+        case 5: {
+            // scroll
+            TargetMouseScroll *ms = [[TargetMouseScroll alloc] init];
+            if ([scrollDirSelect selectedSegment] == 0) {
+                [ms setHowMuch: -1];
+            }
+            else {
+                [ms setHowMuch: 1];
+            }
+            return ms;
+        }
+        case 6: {
+            // toggle mouse scope
+            TargetToggleMouseScope *tms = [[TargetToggleMouseScope alloc] init];
+            return tms;
+        }
        }
        return NULL;
 }
 -(void) reset {
        [keyInput clear];
        [radioButtons setState: 1 atRow: 0 column: 0];
+    [mouseDirSelect setSelectedSegment: 0];
     [mouseBtnSelect setSelectedSegment: 0];
+    [scrollDirSelect setSelectedSegment: 0];
        [self refreshConfigsPreservingSelection: NO];
 }
 
        [radioButtons setEnabled: enabled];
        [keyInput setEnabled: enabled];
        [configPopup setEnabled: enabled];
+    [mouseDirSelect setEnabled: enabled];
     [mouseBtnSelect setEnabled: enabled];
+    [scrollDirSelect setEnabled: enabled];
 }
 -(BOOL) enabled {
        return [radioButtons isEnabled];
                [configPopup selectItemAtIndex: [[configsController configs] indexOfObject: [(TargetConfig*)target config]]];
     }
     else if ([target isKindOfClass: [TargetMouseMove class]]) {
-        if ([(TargetMouseMove *)target dir] == 0)
-            [radioButtons setState:1 atRow: 3 column: 0];
-        else
-            [radioButtons setState:1 atRow: 4 column: 0];
+        [radioButtons setState:1 atRow: 3 column: 0];
+        [mouseDirSelect setSelectedSegment: [(TargetMouseMove *)target dir]];
        }
     else if ([target isKindOfClass: [TargetMouseBtn class]]) {
-        [radioButtons setState: 1 atRow: 5 column: 0];
+        [radioButtons setState: 1 atRow: 4 column: 0];
         if ([(TargetMouseBtn *)target which] == kCGMouseButtonLeft)
             [mouseBtnSelect setSelectedSegment: 0];
         else
             [mouseBtnSelect setSelectedSegment: 1];
+    }
+    else if ([target isKindOfClass: [TargetMouseScroll class]]) {
+        [radioButtons setState: 1 atRow: 5 column: 0];
+        if ([(TargetMouseScroll *)target howMuch] < 0)
+            [scrollDirSelect setSelectedSegment: 0];
+        else
+            [scrollDirSelect setSelectedSegment: 1];
+    }
+    else if ([target isKindOfClass: [TargetToggleMouseScope class]]) {
+        [radioButtons setState: 1 atRow: 6 column: 0];
     } else {
                [NSException raise:@"Unknown target subclass" format:@"Unknown target subclass"];
        }
index 7bf9f837d726fafd0f0e22197455f84e67ea0f62..40661b8c2a4b41e42d8f534efaef1569c763af1a 100644 (file)
        return target;
 }
 
--(void) trigger {
+-(void) trigger: (JoystickController *)jc {
        CGEventRef keyDown = CGEventCreateKeyboardEvent(NULL, vk, true);
        CGEventPost(kCGHIDEventTap, keyDown);
        CFRelease(keyDown);
 }
 
--(void) untrigger {
+-(void) untrigger: (JoystickController *)jc {
        CGEventRef keyUp = CGEventCreateKeyboardEvent(NULL, vk, false);
        CGEventPost(kCGHIDEventTap, keyUp);
        CFRelease(keyUp);
index 857de7b090647cc0d3234054143c832b50af1e62..74298746cfd67fa3d990aea981364d851b046f02 100644 (file)
@@ -23,7 +23,7 @@
        return target;
 }
 
--(void) trigger {
+-(void) trigger: (JoystickController *)jc {
     NSRect screenRect = [[NSScreen mainScreen] frame];
     NSInteger height = screenRect.size.height;
     NSPoint mouseLoc = [NSEvent mouseLocation];
@@ -36,7 +36,7 @@
     CFRelease(click);
 }
 
--(void) untrigger {
+-(void) untrigger: (JoystickController *)jc {
     NSRect screenRect = [[NSScreen mainScreen] frame];
     NSInteger height = screenRect.size.height;
     NSPoint mouseLoc = [NSEvent mouseLocation];
index 2bcbce378a194557116cdb6e9618a81fb4fe9f50..8cf09d2c508a3fb418f3705911b3eac31859dd12 100644 (file)
 
 @implementation TargetMouseMove
 
--(void) setInputValue: (int) newIV {
-    NSRect screenRect = [[NSScreen mainScreen] frame];
-    NSInteger height = screenRect.size.height;
-    NSPoint mouseLoc = [NSEvent mouseLocation];
-    if (dir == 0)
-        mouseLoc.x += newIV;
-    else
-        mouseLoc.y += newIV;
-    
-    CGEventRef move = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved,
-                                              CGPointMake(mouseLoc.x, height - mouseLoc.y),
-                                              kCGMouseButtonLeft);
-    CGEventPost(kCGHIDEventTap, move);
-    CFRelease(move);
+-(BOOL) isContinuous {
+    return true;
 }
 
 @synthesize dir;
        return target;
 }
 
--(void) trigger {
+-(void) trigger: (JoystickController *)jc {
     return;
 }
 
--(void) untrigger {
+-(void) untrigger: (JoystickController *)jc {
     return;
 }
 
+-(void) update: (JoystickController *)jc {
+    //printf("Dir %d inputValue %f\n", [self dir], [self inputValue]);
+    if (fabs([self inputValue]) < 0.01)
+        return; // dead zone
+    
+    NSRect screenRect = [[NSScreen mainScreen] frame];
+    NSInteger height = screenRect.size.height;
+    
+    // TODO
+    double speed = 4.0;
+    if ([jc frontWindowOnly])
+        speed = 12.0;
+    double dx = 0.0, dy = 0.0;
+    if ([self dir] == 0)
+        dx = [self inputValue] * speed;
+    else
+        dy = [self inputValue] * speed;
+    NSPoint *mouseLoc = &jc->mouseLoc;
+    mouseLoc->x += dx;
+    mouseLoc->y -= dy;
+    
+    CGEventRef move = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved,
+                                              CGPointMake(mouseLoc->x, height - mouseLoc->y),
+                                              0);
+    CGEventSetType(move, kCGEventMouseMoved);
+    CGEventSetIntegerValueField(move, kCGMouseEventDeltaX, dx);
+    CGEventSetIntegerValueField(move, kCGMouseEventDeltaY, dy);
+    
+    if ([jc frontWindowOnly]) {
+        ProcessSerialNumber psn;
+        GetFrontProcess(&psn);
+        CGEventPostToPSN(&psn, move);
+    }
+    else {
+        CGEventPost(kCGHIDEventTap, move);
+    }
+    
+    CFRelease(move);
+}
+
 @end
diff --git a/TargetMouseScroll.h b/TargetMouseScroll.h
new file mode 100644 (file)
index 0000000..ddafef4
--- /dev/null
@@ -0,0 +1,19 @@
+//
+//  TargetMouseScroll.h
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/28/12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface TargetMouseScroll : Target {
+    int howMuch;
+}
+
+@property(readwrite) int howMuch;
+
++(TargetMouseScroll*) unstringifyImpl: (NSArray*) comps;
+
+@end
diff --git a/TargetMouseScroll.m b/TargetMouseScroll.m
new file mode 100644 (file)
index 0000000..a1cca9c
--- /dev/null
@@ -0,0 +1,35 @@
+//
+//  TargetMouseScroll.m
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/28/12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "TargetMouseScroll.h"
+
+@implementation TargetMouseScroll
+
+@synthesize howMuch;
+
+-(NSString*) stringify {
+       return [[NSString alloc] initWithFormat: @"mscroll~%d", howMuch];
+}
+
++(TargetMouseScroll*) unstringifyImpl: (NSArray*) comps {
+       NSParameterAssert([comps count] == 2);
+       TargetMouseScroll* target = [[TargetMouseScroll alloc] init];
+       [target setHowMuch: [[comps objectAtIndex:1] integerValue]];
+       return target;
+}
+
+-(void) trigger: (JoystickController *)jc {
+    CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
+                                                      kCGScrollEventUnitLine,
+                                                      1,
+                                                      [self howMuch]);
+    CGEventPost(kCGHIDEventTap, scroll);
+    CFRelease(scroll);
+}
+
+@end
diff --git a/TargetToggleMouseScope.h b/TargetToggleMouseScope.h
new file mode 100644 (file)
index 0000000..f167b5e
--- /dev/null
@@ -0,0 +1,15 @@
+//
+//  TargetToggleMouseScope.h
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/28/12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "Target.h"
+
+@interface TargetToggleMouseScope : Target
+
++(TargetToggleMouseScope*) unstringifyImpl: (NSArray*) comps;
+
+@end
diff --git a/TargetToggleMouseScope.m b/TargetToggleMouseScope.m
new file mode 100644 (file)
index 0000000..55357e5
--- /dev/null
@@ -0,0 +1,28 @@
+//
+//  TargetToggleMouseScope.m
+//  Enjoy
+//
+//  Created by Yifeng Huang on 7/28/12.
+//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
+//
+
+#import "TargetToggleMouseScope.h"
+
+@implementation TargetToggleMouseScope
+
+-(NSString*) stringify {
+       return [[NSString alloc] initWithFormat: @"mtoggle"];
+}
+
++(TargetToggleMouseScope*) unstringifyImpl: (NSArray*) comps {
+       NSParameterAssert([comps count] == 1);
+       TargetToggleMouseScope* target = [[TargetToggleMouseScope alloc] init];
+       return target;
+}
+
+-(void) trigger: (JoystickController *)jc {
+    [jc setFrontWindowOnly: ![jc frontWindowOnly]];
+    printf("Front window only: %d\n", [jc frontWindowOnly]);
+}
+
+@end
diff --git a/icon.icns b/icon.icns
new file mode 100644 (file)
index 0000000..d9a900d
Binary files /dev/null and b/icon.icns differ