Skip to content

Commit

Permalink
Fixed keyboard editor
Browse files Browse the repository at this point in the history
Removed unneeded stuff
  • Loading branch information
0xe1f committed Apr 11, 2016
1 parent 64dc6ae commit d993b73
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 229 deletions.
7 changes: 0 additions & 7 deletions Cocoa/CMKeyboardManager.h
Expand Up @@ -34,13 +34,6 @@
@end @end


@interface CMKeyboardManager : NSObject @interface CMKeyboardManager : NSObject
{
IOHIDManagerRef keyboardHidManager;
NSMutableArray *observers;

@private
NSObject *observerLock;
}


+ (CMKeyboardManager *)sharedInstance; + (CMKeyboardManager *)sharedInstance;


Expand Down
5 changes: 5 additions & 0 deletions Cocoa/CMKeyboardManager.m
Expand Up @@ -36,6 +36,11 @@ - (void)keyStateDidChange:(NSInteger)scanCode
@end @end


@implementation CMKeyboardManager @implementation CMKeyboardManager
{
IOHIDManagerRef keyboardHidManager;
NSMutableArray *observers;
NSObject *observerLock;
}


+ (CMKeyboardManager *)sharedInstance + (CMKeyboardManager *)sharedInstance
{ {
Expand Down
42 changes: 0 additions & 42 deletions Cocoa/CMMSXJoystick.h

This file was deleted.

135 changes: 0 additions & 135 deletions Cocoa/CMMSXJoystick.m

This file was deleted.

6 changes: 0 additions & 6 deletions CocoaMSX.xcodeproj/project.pbxproj
Expand Up @@ -356,7 +356,6 @@
FEA4548D1679B65300AAECB7 /* DiskDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = FEA4548C1679B65300AAECB7 /* DiskDocument.icns */; }; FEA4548D1679B65300AAECB7 /* DiskDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = FEA4548C1679B65300AAECB7 /* DiskDocument.icns */; };
FEA454901679BAF700AAECB7 /* CassetteDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = FEA4548F1679BAF700AAECB7 /* CassetteDocument.icns */; }; FEA454901679BAF700AAECB7 /* CassetteDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = FEA4548F1679BAF700AAECB7 /* CassetteDocument.icns */; };
FEA6E8A416EB0A2800A580CF /* CMMSXKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FEA6E8A316EB0A2800A580CF /* CMMSXKeyboard.m */; }; FEA6E8A416EB0A2800A580CF /* CMMSXKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = FEA6E8A316EB0A2800A580CF /* CMMSXKeyboard.m */; };
FEA6E8A716EB223100A580CF /* CMMSXJoystick.m in Sources */ = {isa = PBXBuildFile; fileRef = FEA6E8A616EB223100A580CF /* CMMSXJoystick.m */; };
FEA74EFD16FC14B60033E2DE /* Data in Resources */ = {isa = PBXBuildFile; fileRef = FEA74EFC16FC14B60033E2DE /* Data */; }; FEA74EFD16FC14B60033E2DE /* Data in Resources */ = {isa = PBXBuildFile; fileRef = FEA74EFC16FC14B60033E2DE /* Data */; };
FEAAF3EF167283C500D371CD /* CMInputDeviceLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = FEAAF3EE167283C500D371CD /* CMInputDeviceLayout.m */; }; FEAAF3EF167283C500D371CD /* CMInputDeviceLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = FEAAF3EE167283C500D371CD /* CMInputDeviceLayout.m */; };
FEAAF3F81672942700D371CD /* CMInputMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = FEAAF3F71672942700D371CD /* CMInputMethod.m */; }; FEAAF3F81672942700D371CD /* CMInputMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = FEAAF3F71672942700D371CD /* CMInputMethod.m */; };
Expand Down Expand Up @@ -1113,8 +1112,6 @@
FEA6277A16A0CAD70048C05C /* cbios.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cbios.txt; sourceTree = "<group>"; }; FEA6277A16A0CAD70048C05C /* cbios.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cbios.txt; sourceTree = "<group>"; };
FEA6E8A216EB0A2800A580CF /* CMMSXKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMMSXKeyboard.h; sourceTree = "<group>"; }; FEA6E8A216EB0A2800A580CF /* CMMSXKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMMSXKeyboard.h; sourceTree = "<group>"; };
FEA6E8A316EB0A2800A580CF /* CMMSXKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMMSXKeyboard.m; sourceTree = "<group>"; }; FEA6E8A316EB0A2800A580CF /* CMMSXKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMMSXKeyboard.m; sourceTree = "<group>"; };
FEA6E8A516EB223100A580CF /* CMMSXJoystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CMMSXJoystick.h; sourceTree = "<group>"; };
FEA6E8A616EB223100A580CF /* CMMSXJoystick.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CMMSXJoystick.m; sourceTree = "<group>"; };
FEA74EFC16FC14B60033E2DE /* Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Data; sourceTree = "<group>"; }; FEA74EFC16FC14B60033E2DE /* Data */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Data; sourceTree = "<group>"; };
FEA841B0187FCD8000F5CD6D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; FEA841B0187FCD8000F5CD6D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
FEA841B2187FCD8000F5CD6D /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; FEA841B2187FCD8000F5CD6D /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -2248,8 +2245,6 @@
FEAAF3EE167283C500D371CD /* CMInputDeviceLayout.m */, FEAAF3EE167283C500D371CD /* CMInputDeviceLayout.m */,
6B1C25AA1672972F004DD618 /* CMKeyboardInput.h */, 6B1C25AA1672972F004DD618 /* CMKeyboardInput.h */,
6B1C25AB1672972F004DD618 /* CMKeyboardInput.m */, 6B1C25AB1672972F004DD618 /* CMKeyboardInput.m */,
FEA6E8A516EB223100A580CF /* CMMSXJoystick.h */,
FEA6E8A616EB223100A580CF /* CMMSXJoystick.m */,
FEA6E8A216EB0A2800A580CF /* CMMSXKeyboard.h */, FEA6E8A216EB0A2800A580CF /* CMMSXKeyboard.h */,
FEA6E8A316EB0A2800A580CF /* CMMSXKeyboard.m */, FEA6E8A316EB0A2800A580CF /* CMMSXKeyboard.m */,
FE2E1961164085A000BCFD53 /* CMPreferences.h */, FE2E1961164085A000BCFD53 /* CMPreferences.h */,
Expand Down Expand Up @@ -2768,7 +2763,6 @@
FE2D857D16E33140003EFB3F /* CMIsZero.m in Sources */, FE2D857D16E33140003EFB3F /* CMIsZero.m in Sources */,
FE2D858016E3480C003EFB3F /* CMAsString.m in Sources */, FE2D858016E3480C003EFB3F /* CMAsString.m in Sources */,
FEA6E8A416EB0A2800A580CF /* CMMSXKeyboard.m in Sources */, FEA6E8A416EB0A2800A580CF /* CMMSXKeyboard.m in Sources */,
FEA6E8A716EB223100A580CF /* CMMSXJoystick.m in Sources */,
FE81439016F797CC000FABC7 /* CMGamepadManager.m in Sources */, FE81439016F797CC000FABC7 /* CMGamepadManager.m in Sources */,
FE81439316F7A191000FABC7 /* CMGamepad.m in Sources */, FE81439316F7A191000FABC7 /* CMGamepad.m in Sources */,
FE05CAD4176CD21200D6CAC0 /* CMConfigureJoystickController.m in Sources */, FE05CAD4176CD21200D6CAC0 /* CMConfigureJoystickController.m in Sources */,
Expand Down
3 changes: 1 addition & 2 deletions Controllers/CMPreferenceController.m
Expand Up @@ -32,7 +32,6 @@


#import "MGScopeBar.h" #import "MGScopeBar.h"


#import "CMMSXJoystick.h"
#import "CMKeyboardInput.h" #import "CMKeyboardInput.h"
#import "CMMachine.h" #import "CMMachine.h"
#import "CMMixerChannel.h" #import "CMMixerChannel.h"
Expand Down Expand Up @@ -1321,7 +1320,7 @@ - (id) outlineView:(NSOutlineView *) outlineView
return nil; return nil;
} else if ([[tableColumn identifier] isEqualToString:@"CMKeyAssignmentColumn"]) { } else if ([[tableColumn identifier] isEqualToString:@"CMKeyAssignmentColumn"]) {
CMKeyboardInput *keyInput = (CMKeyboardInput *)[[theEmulator keyboardLayout] inputMethodForVirtualCode:virtualCode]; CMKeyboardInput *keyInput = (CMKeyboardInput *)[[theEmulator keyboardLayout] inputMethodForVirtualCode:virtualCode];
return [CMKeyCaptureView descriptionForKeyCode:@([keyInput keyCode])]; return [CMKeyCaptureView descriptionForKeyCode:[keyInput keyCode]];
} }
} }


Expand Down
77 changes: 42 additions & 35 deletions Resources/ConfigureJoystick.xib
Expand Up @@ -17,49 +17,21 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" animationBehavior="default" id="1"> <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" animationBehavior="default" id="1">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="196" y="240" width="430" height="300"/> <rect key="contentRect" x="196" y="240" width="430" height="278"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/> <rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
<view key="contentView" id="2"> <view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="430" height="300"/> <rect key="frame" x="0.0" y="0.0" width="430" height="278"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<button verticalHuggingPriority="750" id="13">
<rect key="frame" x="320" y="13" width="96" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Save" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="14">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
DQ
</string>
</buttonCell>
<connections>
<action selector="saveChanges:" target="-2" id="8Bg-PB-bSw"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="16">
<rect key="frame" x="224" y="13" width="96" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="17">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancelChanges:" target="-2" id="Vhc-2b-ZIx"/>
</connections>
</button>
<scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="jFC-Qi-mc5"> <scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="jFC-Qi-mc5">
<rect key="frame" x="20" y="104" width="390" height="176"/> <rect key="frame" x="20" y="101" width="390" height="157"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<clipView key="contentView" id="LvQ-rO-mxP"> <clipView key="contentView" id="LvQ-rO-mxP">
<rect key="frame" x="1" y="23" width="388" height="152"/> <rect key="frame" x="1" y="0.0" width="388" height="156"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="Ekf-s2-NvB" id="Icy-7g-75c"> <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="Ekf-s2-NvB" id="Icy-7g-75c">
<rect key="frame" x="0.0" y="0.0" width="322" height="19"/> <rect key="frame" x="0.0" y="0.0" width="388" height="133"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/> <size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -113,14 +85,21 @@ Gw
</tableHeaderView> </tableHeaderView>
</scrollView> </scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="RsH-JI-az6"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="RsH-JI-az6">
<rect key="frame" x="18" y="49" width="394" height="47"/> <rect key="frame" x="18" y="61" width="394" height="32"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Currently editing input" id="pN7-Kt-rbe"> <textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Currently editing input" id="pN7-Kt-rbe">
<font key="font" metaFont="smallSystem"/> <font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
<box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="rXa-Ou-Abl">
<rect key="frame" x="20" y="50" width="390" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<button verticalHuggingPriority="750" id="BLD-wX-CL8"> <button verticalHuggingPriority="750" id="BLD-wX-CL8">
<rect key="frame" x="14" y="13" width="115" height="32"/> <rect key="frame" x="14" y="13" width="115" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
Expand All @@ -132,12 +111,40 @@ Gw
<action selector="resetToDefault:" target="-2" id="wiM-D5-QVl"/> <action selector="resetToDefault:" target="-2" id="wiM-D5-QVl"/>
</connections> </connections>
</button> </button>
<button verticalHuggingPriority="750" id="16">
<rect key="frame" x="224" y="13" width="96" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="17">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="cancelChanges:" target="-2" id="Vhc-2b-ZIx"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="13">
<rect key="frame" x="320" y="13" width="96" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Save" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="14">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<string key="keyEquivalent" base64-UTF8="YES">
DQ
</string>
</buttonCell>
<connections>
<action selector="saveChanges:" target="-2" id="8Bg-PB-bSw"/>
</connections>
</button>
</subviews> </subviews>
</view> </view>
<connections> <connections>
<outlet property="delegate" destination="-2" id="11"/> <outlet property="delegate" destination="-2" id="11"/>
</connections> </connections>
<point key="canvasLocation" x="443" y="570"/> <point key="canvasLocation" x="443" y="559"/>
</window> </window>
</objects> </objects>
</document> </document>

0 comments on commit d993b73

Please sign in to comment.