diff --git a/.xctool-args b/.xctool-args new file mode 100644 index 0000000..ed82971 --- /dev/null +++ b/.xctool-args @@ -0,0 +1,4 @@ +[ + "-project", "AccessBraille/AccessBraille.xcodeproj", + "-scheme", "AccessBraille" +] diff --git a/AccessBraille/AccessBraille.xcodeproj/project.pbxproj b/AccessBraille/AccessBraille.xcodeproj/project.pbxproj index 766321c..b338e63 100644 --- a/AccessBraille/AccessBraille.xcodeproj/project.pbxproj +++ b/AccessBraille/AccessBraille.xcodeproj/project.pbxproj @@ -38,20 +38,16 @@ 2CE1B413178B5064009B8E1D /* disableCapsSound.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 2CE1B40F178B5064009B8E1D /* disableCapsSound.aiff */; }; 2CE1B414178B5064009B8E1D /* enableCapsSound.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 2CE1B410178B5064009B8E1D /* enableCapsSound.aiff */; }; 2CE1B415178B5064009B8E1D /* enableCapsSound.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 2CE1B410178B5064009B8E1D /* enableCapsSound.aiff */; }; - 2CF45FD017956EF300E6C69E /* menuTag.png in Resources */ = {isa = PBXBuildFile; fileRef = 2CF45FCF17956EF300E6C69E /* menuTag.png */; }; - 2CF45FD317957A4200E6C69E /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CF45FD217957A4200E6C69E /* SettingsViewController.m */; }; - 2CF45FD61795E51600E6C69E /* disableKeyboard.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 2CF45FD41795E51600E6C69E /* disableKeyboard.aiff */; }; - 2CF45FD71795E51600E6C69E /* enableKeyboard.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 2CF45FD51795E51600E6C69E /* enableKeyboard.aiff */; }; 3FFEFAFC1778D8A3004CBAF3 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FFEFAFB1778D8A3004CBAF3 /* CoreFoundation.framework */; }; 4C05CE191778AFD300F80C70 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C05CE171778AFD300F80C70 /* InfoPlist.strings */; }; 4C05CE1F1778B10000F80C70 /* ABParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C10E23517302D8600A2864B /* ABParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4C05CE201778B11300F80C70 /* ABKeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CEE19A216FCA05400E36128 /* ABKeyboard.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4C05CE211778B16700F80C70 /* ABSpeak.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C10E23717302D8600A2864B /* ABSpeak.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4C05CE221778B16D00F80C70 /* ABTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C433B8F1705DF4B003D2DE7 /* ABTypes.h */; }; - 4C05CE231778B17000F80C70 /* ABActivateKeyboardGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CEE19A016FCA05400E36128 /* ABActivateKeyboardGestureRecognizer.h */; }; - 4C05CE241778B17400F80C70 /* ABBrailleReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C1B824E171316F60035797D /* ABBrailleReader.h */; }; - 4C05CE251778B17800F80C70 /* ABTouchLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C50A416170DCA8F00D03D44 /* ABTouchLayer.h */; }; - 4C05CE261778B17A00F80C70 /* ABTouchView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C092A5E170F1AFA00650986 /* ABTouchView.h */; }; + 4C05CE221778B16D00F80C70 /* ABTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C433B8F1705DF4B003D2DE7 /* ABTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4C05CE231778B17000F80C70 /* ABActivateKeyboardGestureRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CEE19A016FCA05400E36128 /* ABActivateKeyboardGestureRecognizer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4C05CE241778B17400F80C70 /* ABBrailleReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C1B824E171316F60035797D /* ABBrailleReader.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4C05CE251778B17800F80C70 /* ABTouchLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C50A416170DCA8F00D03D44 /* ABTouchLayer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4C05CE261778B17A00F80C70 /* ABTouchView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C092A5E170F1AFA00650986 /* ABTouchView.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4C05CE271778B18700F80C70 /* ABParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C10E23617302D8600A2864B /* ABParser.m */; }; 4C05CE281778B18700F80C70 /* ABSpeak.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C10E23817302D8600A2864B /* ABSpeak.m */; }; 4C05CE291778B18700F80C70 /* ABTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB222AD1706063E00BD3608 /* ABTypes.m */; }; @@ -104,6 +100,32 @@ 4C1B1E1C175CC92B00A3DEDA /* icon144.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C1B1E1B175CC92B00A3DEDA /* icon144.png */; }; 4C2B0B1916F37A2D00CC64F2 /* InstructionsMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2B0B1516F37A2D00CC64F2 /* InstructionsMenu.m */; }; 4C2F59E916F76EBC008F8185 /* menuDiscriptions.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4C2F59E816F76EBC008F8185 /* menuDiscriptions.plist */; }; + 4C3605A51795E8AF00777EC4 /* menuTag.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605A41795E8AF00777EC4 /* menuTag.png */; }; + 4C3605BE1795E8D100777EC4 /* cabinFloorLeave.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605A61795E8D100777EC4 /* cabinFloorLeave.aiff */; }; + 4C3605BF1795E8D100777EC4 /* cabinFloorLook.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605A71795E8D100777EC4 /* cabinFloorLook.aiff */; }; + 4C3605C01795E8D100777EC4 /* cabinFloorPick.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605A81795E8D100777EC4 /* cabinFloorPick.aiff */; }; + 4C3605C11795E8D100777EC4 /* cabinFloorPuzzle.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605A91795E8D100777EC4 /* cabinFloorPuzzle.aiff */; }; + 4C3605C21795E8D100777EC4 /* crashSite.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605AA1795E8D100777EC4 /* crashSite.aiff */; }; + 4C3605C31795E8D100777EC4 /* crashSiteLeave.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605AB1795E8D100777EC4 /* crashSiteLeave.aiff */; }; + 4C3605C41795E8D100777EC4 /* crashSiteLook.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605AC1795E8D100777EC4 /* crashSiteLook.aiff */; }; + 4C3605C51795E8D100777EC4 /* darkCaveBlock.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605AD1795E8D100777EC4 /* darkCaveBlock.aiff */; }; + 4C3605C61795E8D100777EC4 /* darkCaveLeave.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605AE1795E8D100777EC4 /* darkCaveLeave.aiff */; }; + 4C3605C71795E8D100777EC4 /* darkCaveLook.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605AF1795E8D100777EC4 /* darkCaveLook.aiff */; }; + 4C3605C81795E8D100777EC4 /* darkCaveUse.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B01795E8D100777EC4 /* darkCaveUse.aiff */; }; + 4C3605C91795E8D100777EC4 /* disableKeyboard.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B11795E8D100777EC4 /* disableKeyboard.aiff */; }; + 4C3605CA1795E8D100777EC4 /* enableKeyboard.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B21795E8D100777EC4 /* enableKeyboard.aiff */; }; + 4C3605CB1795E8D100777EC4 /* femaleHmm.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B31795E8D100777EC4 /* femaleHmm.aiff */; }; + 4C3605CC1795E8D100777EC4 /* finalCavernLeave.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B41795E8D100777EC4 /* finalCavernLeave.aiff */; }; + 4C3605CD1795E8D100777EC4 /* finalCavernLook.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B51795E8D100777EC4 /* finalCavernLook.aiff */; }; + 4C3605CE1795E8D100777EC4 /* finalCavernPick.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B61795E8D100777EC4 /* finalCavernPick.aiff */; }; + 4C3605CF1795E8D100777EC4 /* forestFloorLeave.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B71795E8D100777EC4 /* forestFloorLeave.aiff */; }; + 4C3605D01795E8D100777EC4 /* forestFloorLook.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B81795E8D100777EC4 /* forestFloorLook.aiff */; }; + 4C3605D11795E8D100777EC4 /* forestFloorPick.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605B91795E8D100777EC4 /* forestFloorPick.aiff */; }; + 4C3605D21795E8D100777EC4 /* secretCabinBlock.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605BA1795E8D100777EC4 /* secretCabinBlock.aiff */; }; + 4C3605D31795E8D100777EC4 /* secretCabinLeave.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605BB1795E8D100777EC4 /* secretCabinLeave.aiff */; }; + 4C3605D41795E8D100777EC4 /* windyLakeLeave.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605BC1795E8D100777EC4 /* windyLakeLeave.aiff */; }; + 4C3605D51795E8D100777EC4 /* windyLakeLook.aiff in Resources */ = {isa = PBXBuildFile; fileRef = 4C3605BD1795E8D100777EC4 /* windyLakeLook.aiff */; }; + 4C3605D81795E98A00777EC4 /* SettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3605D71795E98A00777EC4 /* SettingsViewController.m */; }; 4C3C91B316CE9D7D00954A54 /* MainMenuNavigation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3C91B216CE9D7D00954A54 /* MainMenuNavigation.m */; }; 4C4CABAF1784647200563621 /* ABBrailleOutput.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C4CABAC17845E7A00563621 /* ABBrailleOutput.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4C4CABB01784647200563621 /* ABBrailleOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CABAD17845E7A00563621 /* ABBrailleOutput.m */; }; @@ -118,9 +140,9 @@ 4CA74DA016F8C99F007036F3 /* MainMenuItemImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA74D9F16F8C99F007036F3 /* MainMenuItemImage.m */; }; 4CB58A211778B6EA00D38D3C /* NSString+helpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C1B1E1D175CF76D00A3DEDA /* NSString+helpers.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4CB58A221778B6EA00D38D3C /* NSString+helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1B1E1E175CF76D00A3DEDA /* NSString+helpers.m */; }; - 4CB58A231778B6EA00D38D3C /* UIView+quickRemove.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C1B1E21175CF76D00A3DEDA /* UIView+quickRemove.h */; }; + 4CB58A231778B6EA00D38D3C /* UIView+quickRemove.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C1B1E21175CF76D00A3DEDA /* UIView+quickRemove.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4CB58A241778B6EA00D38D3C /* UIView+quickRemove.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1B1E22175CF76D00A3DEDA /* UIView+quickRemove.m */; }; - 4CB58A271778B6EA00D38D3C /* UITextView+simpleadd.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C61BEA417787D2700904C7D /* UITextView+simpleadd.h */; }; + 4CB58A271778B6EA00D38D3C /* UITextView+simpleadd.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C61BEA417787D2700904C7D /* UITextView+simpleadd.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4CB58A281778B6EA00D38D3C /* UITextView+simpleadd.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C61BEA517787D2700904C7D /* UITextView+simpleadd.m */; }; 4CB58A291778B73900D38D3C /* NSArray+ObjectSubsets.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEFD38B16EE1F9100961754 /* NSArray+ObjectSubsets.m */; }; 4CB58A2B1778B89700D38D3C /* FlashCard.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C569AA517147A7B0073D8F8 /* FlashCard.m */; }; @@ -207,11 +229,6 @@ 2CCB754C173BF3B40059E580 /* hard.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = hard.plist; sourceTree = ""; }; 2CE1B40F178B5064009B8E1D /* disableCapsSound.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; name = disableCapsSound.aiff; path = ../../accessbraille_resources/Sounds/disableCapsSound.aiff; sourceTree = ""; }; 2CE1B410178B5064009B8E1D /* enableCapsSound.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; name = enableCapsSound.aiff; path = ../../accessbraille_resources/Sounds/enableCapsSound.aiff; sourceTree = ""; }; - 2CF45FCF17956EF300E6C69E /* menuTag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = menuTag.png; path = ../../accessbraille_resources/Images/menuTag.png; sourceTree = ""; }; - 2CF45FD117957A4200E6C69E /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = ""; }; - 2CF45FD217957A4200E6C69E /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = ""; }; - 2CF45FD41795E51600E6C69E /* disableKeyboard.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; name = disableKeyboard.aiff; path = ../../accessbraille_resources/Sounds/disableKeyboard.aiff; sourceTree = ""; }; - 2CF45FD51795E51600E6C69E /* enableKeyboard.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; name = enableKeyboard.aiff; path = ../../accessbraille_resources/Sounds/enableKeyboard.aiff; sourceTree = ""; }; 3FFEFAFB1778D8A3004CBAF3 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 4C05CE111778AFD200F80C70 /* ABKeyboard.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ABKeyboard.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4C05CE161778AFD300F80C70 /* ABKeyboard-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ABKeyboard-Info.plist"; sourceTree = ""; }; @@ -267,6 +284,33 @@ 4C2B0B1416F37A2D00CC64F2 /* InstructionsMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InstructionsMenu.h; sourceTree = ""; }; 4C2B0B1516F37A2D00CC64F2 /* InstructionsMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InstructionsMenu.m; sourceTree = ""; }; 4C2F59E816F76EBC008F8185 /* menuDiscriptions.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = menuDiscriptions.plist; sourceTree = ""; }; + 4C3605A41795E8AF00777EC4 /* menuTag.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menuTag.png; sourceTree = ""; }; + 4C3605A61795E8D100777EC4 /* cabinFloorLeave.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = cabinFloorLeave.aiff; sourceTree = ""; }; + 4C3605A71795E8D100777EC4 /* cabinFloorLook.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = cabinFloorLook.aiff; sourceTree = ""; }; + 4C3605A81795E8D100777EC4 /* cabinFloorPick.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = cabinFloorPick.aiff; sourceTree = ""; }; + 4C3605A91795E8D100777EC4 /* cabinFloorPuzzle.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = cabinFloorPuzzle.aiff; sourceTree = ""; }; + 4C3605AA1795E8D100777EC4 /* crashSite.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = crashSite.aiff; sourceTree = ""; }; + 4C3605AB1795E8D100777EC4 /* crashSiteLeave.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = crashSiteLeave.aiff; sourceTree = ""; }; + 4C3605AC1795E8D100777EC4 /* crashSiteLook.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = crashSiteLook.aiff; sourceTree = ""; }; + 4C3605AD1795E8D100777EC4 /* darkCaveBlock.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = darkCaveBlock.aiff; sourceTree = ""; }; + 4C3605AE1795E8D100777EC4 /* darkCaveLeave.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = darkCaveLeave.aiff; sourceTree = ""; }; + 4C3605AF1795E8D100777EC4 /* darkCaveLook.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = darkCaveLook.aiff; sourceTree = ""; }; + 4C3605B01795E8D100777EC4 /* darkCaveUse.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = darkCaveUse.aiff; sourceTree = ""; }; + 4C3605B11795E8D100777EC4 /* disableKeyboard.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = disableKeyboard.aiff; sourceTree = ""; }; + 4C3605B21795E8D100777EC4 /* enableKeyboard.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = enableKeyboard.aiff; sourceTree = ""; }; + 4C3605B31795E8D100777EC4 /* femaleHmm.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = femaleHmm.aiff; sourceTree = ""; }; + 4C3605B41795E8D100777EC4 /* finalCavernLeave.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = finalCavernLeave.aiff; sourceTree = ""; }; + 4C3605B51795E8D100777EC4 /* finalCavernLook.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = finalCavernLook.aiff; sourceTree = ""; }; + 4C3605B61795E8D100777EC4 /* finalCavernPick.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = finalCavernPick.aiff; sourceTree = ""; }; + 4C3605B71795E8D100777EC4 /* forestFloorLeave.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = forestFloorLeave.aiff; sourceTree = ""; }; + 4C3605B81795E8D100777EC4 /* forestFloorLook.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = forestFloorLook.aiff; sourceTree = ""; }; + 4C3605B91795E8D100777EC4 /* forestFloorPick.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = forestFloorPick.aiff; sourceTree = ""; }; + 4C3605BA1795E8D100777EC4 /* secretCabinBlock.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = secretCabinBlock.aiff; sourceTree = ""; }; + 4C3605BB1795E8D100777EC4 /* secretCabinLeave.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = secretCabinLeave.aiff; sourceTree = ""; }; + 4C3605BC1795E8D100777EC4 /* windyLakeLeave.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = windyLakeLeave.aiff; sourceTree = ""; }; + 4C3605BD1795E8D100777EC4 /* windyLakeLook.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = windyLakeLook.aiff; sourceTree = ""; }; + 4C3605D61795E98A00777EC4 /* SettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsViewController.h; sourceTree = ""; }; + 4C3605D71795E98A00777EC4 /* SettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingsViewController.m; sourceTree = ""; }; 4C3C91B116CE9D7D00954A54 /* MainMenuNavigation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainMenuNavigation.h; sourceTree = ""; }; 4C3C91B216CE9D7D00954A54 /* MainMenuNavigation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainMenuNavigation.m; sourceTree = ""; }; 4C433B8F1705DF4B003D2DE7 /* ABTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ABTypes.h; sourceTree = ""; }; @@ -498,7 +542,7 @@ A934326C16A070CB00C659C1 /* Images */ = { isa = PBXGroup; children = ( - 2CF45FCF17956EF300E6C69E /* menuTag.png */, + 4C3605A41795E8AF00777EC4 /* menuTag.png */, 4C1B1E0B175CC8FA00A3DEDA /* Default-568h@2x.png */, 4C1B1E0C175CC8FA00A3DEDA /* Default.png */, 4C1B1E0D175CC8FA00A3DEDA /* Default@2x.png */, @@ -642,8 +686,30 @@ A9ECC82116A764C300998AD4 /* Resources */ = { isa = PBXGroup; children = ( - 2CF45FD41795E51600E6C69E /* disableKeyboard.aiff */, - 2CF45FD51795E51600E6C69E /* enableKeyboard.aiff */, + 4C3605A61795E8D100777EC4 /* cabinFloorLeave.aiff */, + 4C3605A71795E8D100777EC4 /* cabinFloorLook.aiff */, + 4C3605A81795E8D100777EC4 /* cabinFloorPick.aiff */, + 4C3605A91795E8D100777EC4 /* cabinFloorPuzzle.aiff */, + 4C3605AA1795E8D100777EC4 /* crashSite.aiff */, + 4C3605AB1795E8D100777EC4 /* crashSiteLeave.aiff */, + 4C3605AC1795E8D100777EC4 /* crashSiteLook.aiff */, + 4C3605AD1795E8D100777EC4 /* darkCaveBlock.aiff */, + 4C3605AE1795E8D100777EC4 /* darkCaveLeave.aiff */, + 4C3605AF1795E8D100777EC4 /* darkCaveLook.aiff */, + 4C3605B01795E8D100777EC4 /* darkCaveUse.aiff */, + 4C3605B11795E8D100777EC4 /* disableKeyboard.aiff */, + 4C3605B21795E8D100777EC4 /* enableKeyboard.aiff */, + 4C3605B31795E8D100777EC4 /* femaleHmm.aiff */, + 4C3605B41795E8D100777EC4 /* finalCavernLeave.aiff */, + 4C3605B51795E8D100777EC4 /* finalCavernLook.aiff */, + 4C3605B61795E8D100777EC4 /* finalCavernPick.aiff */, + 4C3605B71795E8D100777EC4 /* forestFloorLeave.aiff */, + 4C3605B81795E8D100777EC4 /* forestFloorLook.aiff */, + 4C3605B91795E8D100777EC4 /* forestFloorPick.aiff */, + 4C3605BA1795E8D100777EC4 /* secretCabinBlock.aiff */, + 4C3605BB1795E8D100777EC4 /* secretCabinLeave.aiff */, + 4C3605BC1795E8D100777EC4 /* windyLakeLeave.aiff */, + 4C3605BD1795E8D100777EC4 /* windyLakeLook.aiff */, 2CE1B40F178B5064009B8E1D /* disableCapsSound.aiff */, 2CE1B410178B5064009B8E1D /* enableCapsSound.aiff */, 2C80FAED178C409D0077BA2D /* lockCapsSound.aiff */, @@ -658,6 +724,8 @@ A9ECC82216A764E900998AD4 /* Controllers */ = { isa = PBXGroup; children = ( + 4C3605D61795E98A00777EC4 /* SettingsViewController.h */, + 4C3605D71795E98A00777EC4 /* SettingsViewController.m */, A9ECC82916A7780B00998AD4 /* NavigationContainer.h */, A9ECC82A16A7780B00998AD4 /* NavigationContainer.m */, A9479C531670034E00CE9475 /* BrailleTyperController.h */, @@ -672,8 +740,6 @@ 2CAAC79F175E2783004680F9 /* TextAdventure.m */, 2CC54E82176615C1001B595A /* AboutViewController.h */, 2CC54E83176615C1001B595A /* AboutViewController.m */, - 2CF45FD117957A4200E6C69E /* SettingsViewController.h */, - 2CF45FD217957A4200E6C69E /* SettingsViewController.m */, ); name = Controllers; sourceTree = ""; @@ -690,12 +756,12 @@ 4CB58A211778B6EA00D38D3C /* NSString+helpers.h in Headers */, 4C4CABAF1784647200563621 /* ABBrailleOutput.h in Headers */, 4CB58A271778B6EA00D38D3C /* UITextView+simpleadd.h in Headers */, - 4C05CE251778B17800F80C70 /* ABTouchLayer.h in Headers */, + 4C05CE221778B16D00F80C70 /* ABTypes.h in Headers */, + 4C05CE231778B17000F80C70 /* ABActivateKeyboardGestureRecognizer.h in Headers */, 4C05CE241778B17400F80C70 /* ABBrailleReader.h in Headers */, + 4C05CE251778B17800F80C70 /* ABTouchLayer.h in Headers */, 4C05CE261778B17A00F80C70 /* ABTouchView.h in Headers */, 4C05CE201778B11300F80C70 /* ABKeyboard.h in Headers */, - 4C05CE221778B16D00F80C70 /* ABTypes.h in Headers */, - 4C05CE231778B17000F80C70 /* ABActivateKeyboardGestureRecognizer.h in Headers */, 4CB58A231778B6EA00D38D3C /* UIView+quickRemove.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -831,13 +897,17 @@ buildActionMask = 2147483647; files = ( A9479C521670034E00CE9475 /* MainStoryboard.storyboard in Resources */, + 4C3605CA1795E8D100777EC4 /* enableKeyboard.aiff in Resources */, 4C11AEA216F0D5A500A9210A /* menu.plist in Resources */, + 4C3605D01795E8D100777EC4 /* forestFloorLook.aiff in Resources */, 4C2F59E916F76EBC008F8185 /* menuDiscriptions.plist in Resources */, 4C751F1816FA052F003967D8 /* MenuTitles.plist in Resources */, 2CCB7549173BF3220059E580 /* easy.plist in Resources */, 2CCB754B173BF3610059E580 /* medium.plist in Resources */, 2CCB754D173BF3B40059E580 /* hard.plist in Resources */, 4C1B1DE9175CC85500A3DEDA /* mainMenu.png in Resources */, + 4C3605D41795E8D100777EC4 /* windyLakeLeave.aiff in Resources */, + 4C3605CC1795E8D100777EC4 /* finalCavernLeave.aiff in Resources */, 4C1B1DEA175CC85500A3DEDA /* mainMenu@2x.png in Resources */, 4C1B1DEB175CC85500A3DEDA /* menuItem0.png in Resources */, 4C1B1DEE175CC85500A3DEDA /* menuItem1.png in Resources */, @@ -845,38 +915,51 @@ 4C1B1DF0175CC85500A3DEDA /* menuItem2.png in Resources */, 4C1B1DF1175CC85500A3DEDA /* menuItem2x90.png in Resources */, 4C1B1DF2175CC85500A3DEDA /* menuItem3.png in Resources */, + 4C3605D51795E8D100777EC4 /* windyLakeLook.aiff in Resources */, 4C1B1DF3175CC85500A3DEDA /* menuItem3x90.png in Resources */, 4C1B1DF4175CC85500A3DEDA /* slideOutMenu.png in Resources */, 4C4CABB21784714400563621 /* About.rtf in Resources */, 4C1B1DF5175CC85500A3DEDA /* HightBar.png in Resources */, 4C1B1DF6175CC85500A3DEDA /* icon144.png in Resources */, 4C1B1DF7175CC85500A3DEDA /* splash-01.png in Resources */, + 4C3605CF1795E8D100777EC4 /* forestFloorLeave.aiff in Resources */, + 4C3605BF1795E8D100777EC4 /* cabinFloorLook.aiff in Resources */, 4C1B1DF8175CC85500A3DEDA /* splash.png in Resources */, 4CB58A2D1778BBB900D38D3C /* numberLookup.plist in Resources */, + 4C3605BE1795E8D100777EC4 /* cabinFloorLeave.aiff in Resources */, + 4C3605C61795E8D100777EC4 /* darkCaveLeave.aiff in Resources */, 4C1B1DF9175CC85500A3DEDA /* splash@2x.png in Resources */, 4C1B1DFA175CC85500A3DEDA /* typerIcon.png in Resources */, + 4C3605C01795E8D100777EC4 /* cabinFloorPick.aiff in Resources */, 4C1B1DFB175CC85500A3DEDA /* icon.png in Resources */, 4C1B1DFC175CC85500A3DEDA /* menuItem.png in Resources */, 4CB58A2C1778BBB900D38D3C /* grade2lookup.plist in Resources */, 4C1B1E04175CC87B00A3DEDA /* navClick.aiff in Resources */, + 4C3605CE1795E8D100777EC4 /* finalCavernPick.aiff in Resources */, 4C1B1E05175CC87B00A3DEDA /* backspace.aiff in Resources */, 4C1B1E06175CC87B00A3DEDA /* correct.aiff in Resources */, + 4C3605D11795E8D100777EC4 /* forestFloorPick.aiff in Resources */, + 4C3605C51795E8D100777EC4 /* darkCaveBlock.aiff in Resources */, 4CB58A321778BBB900D38D3C /* prefixLevelSix.plist in Resources */, 4CB58A301778BBB900D38D3C /* prefixLevelFour.plist in Resources */, 2CE1B414178B5064009B8E1D /* enableCapsSound.aiff in Resources */, 4CB58A341778BBB900D38D3C /* shortHandLookup.plist in Resources */, 4CB58A311778BBB900D38D3C /* prefixLevelFive.plist in Resources */, + 4C3605C71795E8D100777EC4 /* darkCaveLook.aiff in Resources */, 4C1B1E09175CC87B00A3DEDA /* incorrect.aiff in Resources */, + 4C3605D31795E8D100777EC4 /* secretCabinLeave.aiff in Resources */, 4C1B1E11175CC8FA00A3DEDA /* Default-568h@2x.png in Resources */, - 2CF45FD61795E51600E6C69E /* disableKeyboard.aiff in Resources */, 4C1B1E13175CC8FA00A3DEDA /* Default@2x.png in Resources */, + 4C3605CB1795E8D100777EC4 /* femaleHmm.aiff in Resources */, 4C1B1E14175CC8FA00A3DEDA /* menuItem0x90.png in Resources */, 4C1B1E15175CC8FA00A3DEDA /* Default-Landscape@2x~ipad.png in Resources */, + 4C3605A51795E8AF00777EC4 /* menuTag.png in Resources */, 4C1B1E16175CC8FA00A3DEDA /* Default-Landscape~ipad.png in Resources */, - 2CF45FD71795E51600E6C69E /* enableKeyboard.aiff in Resources */, + 4C3605C11795E8D100777EC4 /* cabinFloorPuzzle.aiff in Resources */, 4C1B1E18175CC91800A3DEDA /* Default-Landscape~ipad.png in Resources */, + 4C3605C31795E8D100777EC4 /* crashSiteLeave.aiff in Resources */, 4C1B1E1A175CC92000A3DEDA /* Default-Landscape@2x~ipad.png in Resources */, - 2CF45FD017956EF300E6C69E /* menuTag.png in Resources */, + 4C3605C91795E8D100777EC4 /* disableKeyboard.aiff in Resources */, 4C1B1E1C175CC92B00A3DEDA /* icon144.png in Resources */, 4CB58A331778BBB900D38D3C /* prefixLevelSeven.plist in Resources */, 4CB58A2E1778BBB900D38D3C /* prefixLevelTwo.plist in Resources */, @@ -885,9 +968,14 @@ 2CAAC7A7175E2A2A004680F9 /* menuItem4x90.png in Resources */, 2CC54E8617661A3A001B595A /* menuItem5.png in Resources */, 2CE1B412178B5064009B8E1D /* disableCapsSound.aiff in Resources */, + 4C3605D21795E8D100777EC4 /* secretCabinBlock.aiff in Resources */, 4CB58A2F1778BBB900D38D3C /* prefixLevelThree.plist in Resources */, + 4C3605C41795E8D100777EC4 /* crashSiteLook.aiff in Resources */, 2CC54E8817661A72001B595A /* menuItem5x90.png in Resources */, + 4C3605C21795E8D100777EC4 /* crashSite.aiff in Resources */, 2C80FAEE178C409D0077BA2D /* lockCapsSound.aiff in Resources */, + 4C3605CD1795E8D100777EC4 /* finalCavernLook.aiff in Resources */, + 4C3605C81795E8D100777EC4 /* darkCaveUse.aiff in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -957,13 +1045,13 @@ A9479C451670034E00CE9475 /* main.m in Sources */, A9479C491670034E00CE9475 /* AppDelegate.m in Sources */, A9479C551670034E00CE9475 /* BrailleTyperController.m in Sources */, + 4C3605D81795E98A00777EC4 /* SettingsViewController.m in Sources */, 4CB58A291778B73900D38D3C /* NSArray+ObjectSubsets.m in Sources */, A9C960D5167F7B4F00084764 /* Drawing.m in Sources */, A9ECC82B16A7780B00998AD4 /* NavigationContainer.m in Sources */, 4C89EA9D16C0158600318BE2 /* ApplicationStore.xcdatamodeld in Sources */, 4CB58A2B1778B89700D38D3C /* FlashCard.m in Sources */, 4C17FA1816C03C9500FFC112 /* BrailleTyper.m in Sources */, - 2CF45FD317957A4200E6C69E /* SettingsViewController.m in Sources */, 4C65356316C443A900611B6F /* MainMenu.m in Sources */, 4C3C91B316CE9D7D00954A54 /* MainMenuNavigation.m in Sources */, 4C2B0B1916F37A2D00CC64F2 /* InstructionsMenu.m in Sources */, @@ -1055,13 +1143,18 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNUSED_FUNCTION = YES; + HEADER_SEARCH_PATHS = ( + "\"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include\"", + "$(inherited)", + ); INFOPLIST_FILE = "ABKeyboard/ABKeyboard-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = iphoneos; @@ -1093,13 +1186,18 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNUSED_FUNCTION = YES; + HEADER_SEARCH_PATHS = ( + "\"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include\"", + "$(inherited)", + ); INFOPLIST_FILE = "ABKeyboard/ABKeyboard-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 6.1; LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = NO; + OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SDKROOT = iphoneos; diff --git a/AccessBraille/AccessBraille.xcodeproj/project.xcworkspace/xcshareddata/AccessBraille.xccheckout b/AccessBraille/AccessBraille.xcodeproj/project.xcworkspace/xcshareddata/AccessBraille.xccheckout index cd4e0ad..68441b5 100644 --- a/AccessBraille/AccessBraille.xcodeproj/project.xcworkspace/xcshareddata/AccessBraille.xccheckout +++ b/AccessBraille/AccessBraille.xcodeproj/project.xcworkspace/xcshareddata/AccessBraille.xccheckout @@ -8,8 +8,6 @@ AccessBraille IDESourceControlProjectOriginsDictionary - 648B01AF-26F5-4A31-8F9C-453C172B4473 - git://github.com/github/specta.git 9A69059F-226A-4219-ACE2-01826BCCED1E https://github.com/ReactiveCocoa/ReactiveCocoa.git FD8919F2-CBFA-4934-9E9D-D32E592A9FF9 @@ -19,8 +17,6 @@ AccessBraille/AccessBraille.xcodeproj/project.xcworkspace IDESourceControlProjectRelativeInstallPathDictionary - 648B01AF-26F5-4A31-8F9C-453C172B4473 - ../../../../../ReactiveCocoa/external/specta 9A69059F-226A-4219-ACE2-01826BCCED1E ../../../RAC FD8919F2-CBFA-4934-9E9D-D32E592A9FF9 @@ -50,14 +46,6 @@ IDESourceControlWCCName RAC - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - 648B01AF-26F5-4A31-8F9C-453C172B4473 - IDESourceControlWCCName - specta - diff --git a/AccessBraille/AccessBraille/ABBrailleReader.h b/AccessBraille/AccessBraille/ABBrailleReader.h index aef77e0..014d726 100644 --- a/AccessBraille/AccessBraille/ABBrailleReader.h +++ b/AccessBraille/AccessBraille/ABBrailleReader.h @@ -22,10 +22,8 @@ static NSString *const ABPrefixLevelSeven = @"000110"; @interface ABBrailleReader : NSObject + (NSString *)brailleStringFromTouchIDs:(NSArray *)touchIDs; -- (void)characterReceived:(NSString *)brailleString; +- (NSString *)characterReceived:(NSString *)brailleString; - (id)initWithAudioTarget:(id)target selector:(SEL)selector; - -// Testing - (NSString *)processString:(NSString *)brailleString; @property (nonatomic) id delegate; diff --git a/AccessBraille/AccessBraille/ABBrailleReader.m b/AccessBraille/AccessBraille/ABBrailleReader.m index 03bec47..103308b 100644 --- a/AccessBraille/AccessBraille/ABBrailleReader.m +++ b/AccessBraille/AccessBraille/ABBrailleReader.m @@ -9,6 +9,7 @@ #import "ABBrailleReader.h" #import "ABKeyboard.h" #import "ABSpeak.h" +#import "ABParser.h" #import "UITextView+simpleadd.h" @implementation ABBrailleReader { @@ -35,7 +36,8 @@ @implementation ABBrailleReader { } -- (id)initWithAudioTarget:(id)tar selector:(SEL)sel { +- (id)init +{ self = [super init]; if (self) { // init lookups @@ -58,12 +60,18 @@ - (id)initWithAudioTarget:(id)tar selector:(SEL)sel { // Setup parser prefix = @""; - + + } + return self; +} + +- (id)initWithAudioTarget:(id)tar selector:(SEL)sel { + self = [self init]; + if (self) { // Audio target = tar; selector = sel; - speak = [[ABSpeak alloc] init]; - + speak = [ABSpeak sharedInstance]; } return self; } @@ -90,11 +98,20 @@ + (NSString *)brailleStringFromTouchIDs:(NSArray *)touchIDs { /** * Receives character from touchLayer in form of braille string */ -- (void)characterReceived:(NSString *)brailleString -{ - [self sendCharacter:[self processString:brailleString]]; +- (NSString *)characterReceived:(NSString *)brailleString +{ + NSString *returnChar = [self processString:brailleString]; + if ([returnChar isEqualToString:ABBackspace]) { + [self sendBackspace]; + } else if (returnChar) { + [self sendCharacter:returnChar]; + } + return returnChar; } +/** + * Checks if a braille string is a prefix + */ + (BOOL)isValidPrefix:(NSString *)braille { return ([braille isEqualToString:ABPrefixLevelOne] || @@ -119,112 +136,162 @@ - (NSString *)processString:(NSString *)brailleString } // Intercept prefix operators - if ([ABBrailleReader isValidPrefix:prefix] && (_grade == ABGradeTwo) && ![brailleString isEqualToString:ABSpaceCharacter]) { + if ((_grade == ABGradeTwo) && [ABBrailleReader isValidPrefix:prefix] && ![brailleString isEqualToString:ABSpaceCharacter]) { // Handle prefix - NSString *postfix = @""; + NSString *postfixChar = @""; if ([prefix isEqualToString:ABPrefixNumber] && [[numberLookup allKeys] containsObject:brailleString]) { - postfix = numberLookup[brailleString]; + postfixChar = numberLookup[brailleString]; } else if ([prefix isEqualToString:ABPrefixLevelTwo] && [[prefixLevelTwo allKeys] containsObject:brailleString]) { - postfix = prefixLevelTwo[brailleString]; + postfixChar = prefixLevelTwo[brailleString]; } else if ([prefix isEqualToString:ABPrefixLevelThree] && [[prefixLevelThree allKeys] containsObject:brailleString]) { - postfix = prefixLevelThree[brailleString]; + postfixChar = prefixLevelThree[brailleString]; } else if ([prefix isEqualToString:ABPrefixLevelFour] && [[prefixLevelFour allKeys] containsObject:brailleString]) { - postfix = prefixLevelFour[brailleString]; + postfixChar = prefixLevelFour[brailleString]; } else if ([prefix isEqualToString:ABPrefixLevelFive] && [[prefixLevelFive allKeys] containsObject:brailleString]) { - postfix = prefixLevelFive[brailleString]; + postfixChar = prefixLevelFive[brailleString]; } else if ([prefix isEqualToString:ABPrefixLevelSix] && [[prefixLevelSix allKeys] containsObject:brailleString]) { - postfix = prefixLevelSix[brailleString]; + postfixChar = prefixLevelSix[brailleString]; } else if ([prefix isEqualToString:ABPrefixLevelSeven] && [[prefixLevelSeven allKeys] containsObject:brailleString]) { - postfix = prefixLevelSeven[brailleString]; + postfixChar = prefixLevelSeven[brailleString]; } - _wordTyping = [_wordTyping stringByAppendingString:postfix]; + _wordTyping = [_wordTyping stringByAppendingString:postfixChar]; if (![prefix isEqualToString:ABPrefixNumber]) { + // If prefix is not a number prefix, clear it prefix = @""; } - return postfix; + // return as a send char + return postfixChar; } else { prefix = brailleString; - if ([ABBrailleReader isValidPrefix:prefix] && (_grade == ABGradeTwo)) { - // return if a valid prefix is set - return @""; - } - // if space proccess last typed word if grade two + // return if a valid prefix is set because it's not a character. + if ([ABBrailleReader isValidPrefix:prefix]) + return nil; + + // if space proccess last typed word if grade two for shorthand lookup. if ([brailleString isEqualToString:ABSpaceCharacter]) { - switch (_grade) { - case ABGradeOne: - break; - case ABGradeTwo: - if ([[shortHandlookup allKeys] containsObject:_wordTyping]) { - _wordTyping = shortHandlookup[_wordTyping]; - } - break; + if (_grade == ABGradeTwo) { + if ([[shortHandlookup allKeys] containsObject:_wordTyping]) { + _wordTyping = shortHandlookup[_wordTyping]; + // Handle updating textview corrently + } } [self sendWord:_wordTyping]; prefix = @""; _wordTyping = @""; - return @""; + return nil; // return nil to not send character } // Is typed character - if (_grade == ABGradeOne && [grade2Lookup[brailleString] length] > 1) { - return @""; - } else { - if ([[grade2Lookup allKeys] containsObject:brailleString]) { - _wordTyping = [_wordTyping stringByAppendingString:grade2Lookup[brailleString]]; - return grade2Lookup[brailleString]; - } else { - return @""; + if ([[grade2Lookup allKeys] containsObject:brailleString]) { + NSString *lookup = grade2Lookup[brailleString]; + switch (_grade) { + case ABGradeOne: + if (lookup.length == 1) { // Grade one is only single char + // Check shift/caps + if(_layer.shift) { + lookup = [lookup uppercaseString]; + _layer.shift = NO; + [_layer setNeedsDisplay]; + } + if (_layer.caps) { + lookup = [lookup uppercaseString]; + } + _wordTyping = [_wordTyping stringByAppendingString:lookup]; + return lookup; + } + break; + case ABGradeTwo: + // Check shift/caps + if(_layer.shift) { + lookup = [NSString stringWithFormat:@"%@%@", [[lookup substringToIndex:1] uppercaseString], [lookup substringFromIndex:1]];; + _layer.shift = NO; + [_layer setNeedsDisplay]; + } + if (_layer.caps) { + lookup = [lookup uppercaseString]; + } + _wordTyping = [_wordTyping stringByAppendingString:lookup]; + return lookup; + break; } } } + return nil; } +#pragma mark Handle updating with infomation + - (void)sendCharacter:(NSString *)string { - if ([string isEqualToString:ABSpaceCharacter]) { - [_fieldOutput insertText:@" "]; - [_delegate characterTyped:@" " withInfo:@{ABGestureInfoStatus : @(YES), - ABSpaceTyped : @(YES), - ABBackspaceReceived : @(NO)}]; - } else if ([string isEqualToString:ABBackspace]) { - [_fieldOutput deleteBackward]; - [_delegate characterTyped:@"" withInfo:@{ABGestureInfoStatus : @(YES), - ABSpaceTyped : @(NO), - ABBackspaceReceived : @(YES)}]; - [target performSelector:selector withObject:ABBackspaceSound]; - } else if ([string isEqualToString:@""]) { - return; - } else { - [speak speakString:string]; - - if(_layer.shift) { - string = [string uppercaseString]; - _layer.shift = NO; - [_layer setNeedsDisplay]; - } - if (_layer.caps) { - string = [string uppercaseString]; - } - - [_fieldOutput insertText:string]; - [_delegate characterTyped:string withInfo:@{ABGestureInfoStatus : @(YES), - ABSpaceTyped : @(NO), - ABBackspaceReceived : @(NO)}]; - } + // Speak + [speak speakString:string]; + + // Update _fieldOutput + if (_fieldOutput) + _fieldOutput.text = [_fieldOutput.text stringByAppendingString:string]; + + // Return char to delegate + [self respondToDelegateWithInfo:@{ABGestureInfoStatus : @(YES), + ABSpaceTyped : @(NO), + ABBackspaceReceived : @(NO)} + wordTyped:NO + string:string]; } - (void)sendWord:(NSString *)string { - NSLog(@"Word Typed: %@", string); + // Speak [speak speakString:string]; - if (![string isEqualToString:ABSpaceCharacter]) { - [_fieldOutput replaceLastWordWithString:string]; + + // Update _fieldOutput + if (_fieldOutput) { + NSArray *words = [ABParser arrayOfWordsFromSentence:_fieldOutput.text]; + NSString *newSent = @""; + for (int i = 0; i < words.count - 1; i++) { + newSent = [newSent stringByAppendingString:words[i]]; + newSent = [newSent stringByAppendingString:@" "]; + } + _fieldOutput.text = [newSent stringByAppendingString:string]; + [_fieldOutput insertText:@" "]; } - [_fieldOutput insertText:@" "]; - [_delegate characterTyped:@" " withInfo:@{ABGestureInfoStatus : @(YES), - ABSpaceTyped : @(YES), - ABBackspaceReceived : @(NO)}]; + // Return word to delegate + [self respondToDelegateWithInfo:@{ABGestureInfoStatus : @(YES), + ABSpaceTyped : @(YES), + ABBackspaceReceived : @(NO)} + wordTyped:NO + string:ABSpaceCharacter]; + [self respondToDelegateWithInfo:@{ABGestureInfoStatus : @(YES), + ABSpaceTyped : @(NO), + ABBackspaceReceived : @(NO)} + wordTyped:YES + string:string]; } +- (void)sendBackspace +{ + // Update _fieldOutput + + if (_fieldOutput && _fieldOutput.text.length > 0) + _fieldOutput.text = [_fieldOutput.text substringWithRange:NSMakeRange(0, _fieldOutput.text.length - 1)]; + + // Return backspace to delegate + [self respondToDelegateWithInfo:@{ABGestureInfoStatus : @(YES), + ABSpaceTyped : @(NO), + ABBackspaceReceived : @(YES)} + wordTyped:NO + string:ABBackspace]; + + // Backspace sound + [target performSelector:selector withObject:ABBackspaceSound]; +} + +- (void)respondToDelegateWithInfo:(NSDictionary *)info wordTyped:(BOOL)word string:(NSString *)string +{ + if (!word && [_delegate respondsToSelector:@selector(characterTyped:withInfo:)]) { + [_delegate characterTyped:string withInfo:info]; + } else if (word && [_delegate respondsToSelector:@selector(wordTyped:withInfo:)]) { + [_delegate wordTyped:string withInfo:info]; + } +} @end diff --git a/AccessBraille/AccessBraille/ABKeyboard.m b/AccessBraille/AccessBraille/ABKeyboard.m index 452d4f8..454c052 100644 --- a/AccessBraille/AccessBraille/ABKeyboard.m +++ b/AccessBraille/AccessBraille/ABKeyboard.m @@ -15,11 +15,15 @@ #import "ABSpeak.h" #import +@interface ABKeyboard () + +@property (retain) ABBrailleReader *brailleReader; + +@end @implementation ABKeyboard { ABTouchLayer *interface; - ABBrailleReader *brailleReader; __strong ABActivateKeyboardGestureRecognizer *activate; // Audio URL paths and AVPlayer. @@ -34,23 +38,17 @@ @implementation ABKeyboard #pragma mark Setup -- (id)initWithDelegate:(id)delegate +- (id)init { self = [super init]; if (self) { - // GR setup - _delegate = delegate; - activate = [[ABActivateKeyboardGestureRecognizer alloc] initWithTarget:self action:@selector(ABKeyboardRecognized:)]; - [activate setTouchDelegate:self]; - [((UIViewController *)_delegate).view addGestureRecognizer:activate]; - // Enable the keyboard _enabled = YES; // Set Up Braille Interp - brailleReader = [[ABBrailleReader alloc] initWithAudioTarget:self selector:@selector(playSound:)]; - [brailleReader setDelegate:_delegate]; - [brailleReader setKeyboardInterface:self]; + _brailleReader = [[ABBrailleReader alloc] initWithAudioTarget:self selector:@selector(playSound:)]; + [_brailleReader setDelegate:_delegate]; + [_brailleReader setKeyboardInterface:self]; // Audio _sound = YES; @@ -59,7 +57,19 @@ - (id)initWithDelegate:(id)delegate disabledURL = [[NSBundle mainBundle] URLForResource:@"disableKeyboard" withExtension:@"aiff"]; backspaceURL = [[NSBundle mainBundle] URLForResource:@"backspace" withExtension:@"aiff"]; - speak = [ABSpeak new]; + speak = [ABSpeak sharedInstance]; + } + return self; +} + +- (id)initWithDelegate:(id)delegate { + self = [self init]; + if (self) { + // GR setup + _delegate = delegate; + activate = [[ABActivateKeyboardGestureRecognizer alloc] initWithTarget:self action:@selector(ABKeyboardRecognized:)]; + [activate setTouchDelegate:self]; + [((UIViewController *)_delegate).view addGestureRecognizer:activate]; } return self; } @@ -68,7 +78,7 @@ - (void)setOutput:(UITextView *)output { _output = output; [_output setInputView:[[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]]; - [brailleReader setFieldOutput:_output]; + [_brailleReader setFieldOutput:_output]; } /** @@ -84,12 +94,12 @@ - (void)Log:(NSString *)str { - (ABGrade)grade { - return brailleReader.grade; + return _brailleReader.grade; } - (void)setGrade:(ABGrade)grade { - [brailleReader setGrade:grade]; + [_brailleReader setGrade:grade]; } #pragma mark Keyboard Implementation @@ -118,8 +128,8 @@ - (void)setUpViewWithTouchesFromABVectorArray:(ABVector[])vectors { [interface setBackgroundColor:[UIColor grayColor]]; [interface setAlpha:0.4]; [interface setClearsContextBeforeDrawing:YES]; - [interface setDelegate:brailleReader]; - [brailleReader setLayer:interface]; + [interface setDelegate:_brailleReader]; + [_brailleReader setLayer:interface]; for (int i = 0; i < 6; i++){ diff --git a/AccessBraille/AccessBraille/UITextView+simpleadd.h b/AccessBraille/AccessBraille/UITextView+simpleadd.h index a215aab..8102cea 100644 --- a/AccessBraille/AccessBraille/UITextView+simpleadd.h +++ b/AccessBraille/AccessBraille/UITextView+simpleadd.h @@ -11,5 +11,6 @@ @interface UITextView (simpleadd) - (void)replaceLastWordWithString:(NSString *)string; +- (NSArray *)arrayOfWordsFromSentence:(NSString *)sentence; @end diff --git a/AccessBraille/AccessBraille/cabinFloorLeave.aiff b/AccessBraille/AccessBraille/cabinFloorLeave.aiff new file mode 100644 index 0000000..7a043ed Binary files /dev/null and b/AccessBraille/AccessBraille/cabinFloorLeave.aiff differ diff --git a/AccessBraille/AccessBraille/cabinFloorLook.aiff b/AccessBraille/AccessBraille/cabinFloorLook.aiff new file mode 100644 index 0000000..0a46930 Binary files /dev/null and b/AccessBraille/AccessBraille/cabinFloorLook.aiff differ diff --git a/AccessBraille/AccessBraille/cabinFloorPick.aiff b/AccessBraille/AccessBraille/cabinFloorPick.aiff new file mode 100644 index 0000000..13c8ccc Binary files /dev/null and b/AccessBraille/AccessBraille/cabinFloorPick.aiff differ diff --git a/AccessBraille/AccessBraille/cabinFloorPuzzle.aiff b/AccessBraille/AccessBraille/cabinFloorPuzzle.aiff new file mode 100644 index 0000000..f9c3489 Binary files /dev/null and b/AccessBraille/AccessBraille/cabinFloorPuzzle.aiff differ diff --git a/AccessBraille/AccessBraille/crashSite.aiff b/AccessBraille/AccessBraille/crashSite.aiff new file mode 100644 index 0000000..8a45e33 Binary files /dev/null and b/AccessBraille/AccessBraille/crashSite.aiff differ diff --git a/AccessBraille/AccessBraille/crashSiteLeave.aiff b/AccessBraille/AccessBraille/crashSiteLeave.aiff new file mode 100644 index 0000000..67b3f18 Binary files /dev/null and b/AccessBraille/AccessBraille/crashSiteLeave.aiff differ diff --git a/AccessBraille/AccessBraille/crashSiteLook.aiff b/AccessBraille/AccessBraille/crashSiteLook.aiff new file mode 100644 index 0000000..cbab170 Binary files /dev/null and b/AccessBraille/AccessBraille/crashSiteLook.aiff differ diff --git a/AccessBraille/AccessBraille/darkCaveBlock.aiff b/AccessBraille/AccessBraille/darkCaveBlock.aiff new file mode 100644 index 0000000..bcc02a0 Binary files /dev/null and b/AccessBraille/AccessBraille/darkCaveBlock.aiff differ diff --git a/AccessBraille/AccessBraille/darkCaveLeave.aiff b/AccessBraille/AccessBraille/darkCaveLeave.aiff new file mode 100644 index 0000000..7a043ed Binary files /dev/null and b/AccessBraille/AccessBraille/darkCaveLeave.aiff differ diff --git a/AccessBraille/AccessBraille/darkCaveLook.aiff b/AccessBraille/AccessBraille/darkCaveLook.aiff new file mode 100644 index 0000000..b883973 Binary files /dev/null and b/AccessBraille/AccessBraille/darkCaveLook.aiff differ diff --git a/AccessBraille/AccessBraille/darkCaveUse.aiff b/AccessBraille/AccessBraille/darkCaveUse.aiff new file mode 100644 index 0000000..8a1d98a Binary files /dev/null and b/AccessBraille/AccessBraille/darkCaveUse.aiff differ diff --git a/AccessBraille/AccessBraille/disableKeyboard.aiff b/AccessBraille/AccessBraille/disableKeyboard.aiff new file mode 100644 index 0000000..d1421ce Binary files /dev/null and b/AccessBraille/AccessBraille/disableKeyboard.aiff differ diff --git a/AccessBraille/AccessBraille/enableKeyboard.aiff b/AccessBraille/AccessBraille/enableKeyboard.aiff new file mode 100644 index 0000000..ea93567 Binary files /dev/null and b/AccessBraille/AccessBraille/enableKeyboard.aiff differ diff --git a/AccessBraille/AccessBraille/femaleHmm.aiff b/AccessBraille/AccessBraille/femaleHmm.aiff new file mode 100644 index 0000000..e05772d Binary files /dev/null and b/AccessBraille/AccessBraille/femaleHmm.aiff differ diff --git a/AccessBraille/AccessBraille/finalCavernLeave.aiff b/AccessBraille/AccessBraille/finalCavernLeave.aiff new file mode 100644 index 0000000..2949014 Binary files /dev/null and b/AccessBraille/AccessBraille/finalCavernLeave.aiff differ diff --git a/AccessBraille/AccessBraille/finalCavernLook.aiff b/AccessBraille/AccessBraille/finalCavernLook.aiff new file mode 100644 index 0000000..f9b7cf6 Binary files /dev/null and b/AccessBraille/AccessBraille/finalCavernLook.aiff differ diff --git a/AccessBraille/AccessBraille/finalCavernPick.aiff b/AccessBraille/AccessBraille/finalCavernPick.aiff new file mode 100644 index 0000000..4193462 Binary files /dev/null and b/AccessBraille/AccessBraille/finalCavernPick.aiff differ diff --git a/AccessBraille/AccessBraille/forestFloorLeave.aiff b/AccessBraille/AccessBraille/forestFloorLeave.aiff new file mode 100644 index 0000000..67b3f18 Binary files /dev/null and b/AccessBraille/AccessBraille/forestFloorLeave.aiff differ diff --git a/AccessBraille/AccessBraille/forestFloorLook.aiff b/AccessBraille/AccessBraille/forestFloorLook.aiff new file mode 100644 index 0000000..cbab170 Binary files /dev/null and b/AccessBraille/AccessBraille/forestFloorLook.aiff differ diff --git a/AccessBraille/AccessBraille/forestFloorPick.aiff b/AccessBraille/AccessBraille/forestFloorPick.aiff new file mode 100644 index 0000000..dea793b Binary files /dev/null and b/AccessBraille/AccessBraille/forestFloorPick.aiff differ diff --git a/AccessBraille/AccessBraille/menuTag.png b/AccessBraille/AccessBraille/menuTag.png new file mode 100644 index 0000000..dd21f60 Binary files /dev/null and b/AccessBraille/AccessBraille/menuTag.png differ diff --git a/AccessBraille/AccessBraille/secretCabinBlock.aiff b/AccessBraille/AccessBraille/secretCabinBlock.aiff new file mode 100644 index 0000000..2e8d347 Binary files /dev/null and b/AccessBraille/AccessBraille/secretCabinBlock.aiff differ diff --git a/AccessBraille/AccessBraille/secretCabinLeave.aiff b/AccessBraille/AccessBraille/secretCabinLeave.aiff new file mode 100644 index 0000000..7a043ed Binary files /dev/null and b/AccessBraille/AccessBraille/secretCabinLeave.aiff differ diff --git a/AccessBraille/AccessBraille/windyLakeLeave.aiff b/AccessBraille/AccessBraille/windyLakeLeave.aiff new file mode 100644 index 0000000..a256a90 Binary files /dev/null and b/AccessBraille/AccessBraille/windyLakeLeave.aiff differ diff --git a/AccessBraille/AccessBraille/windyLakeLook.aiff b/AccessBraille/AccessBraille/windyLakeLook.aiff new file mode 100644 index 0000000..3c65592 Binary files /dev/null and b/AccessBraille/AccessBraille/windyLakeLook.aiff differ diff --git a/AccessBraille/AccessBrailleTests/AccessBrailleTests.m b/AccessBraille/AccessBrailleTests/AccessBrailleTests.m index 6a130cf..227d0f8 100644 --- a/AccessBraille/AccessBrailleTests/AccessBrailleTests.m +++ b/AccessBraille/AccessBrailleTests/AccessBrailleTests.m @@ -17,6 +17,12 @@ #import "MainMenuItemImage.h" #import "ABBrailleOutput.h" +@interface ABKeyboard () + +@property (retain) ABBrailleReader *brailleReader; + +@end + @implementation AccessBrailleTests - (void)setUp @@ -60,112 +66,189 @@ - (void)testABParser { - (void)testABReaderGrade1 { - ABBrailleReader *reader = [[ABBrailleReader alloc] initWithAudioTarget:nil selector:nil]; + ABBrailleReader *reader = [ABBrailleReader new]; // Test Grade 1 [reader setGrade:ABGradeOne]; - STAssertEqualObjects(@"a", [reader processString:@"100000"], @"failed"); - STAssertEqualObjects(@"b", [reader processString:@"110000"], @"failed"); - STAssertEqualObjects(@"c", [reader processString:@"100100"], @"failed"); - STAssertEqualObjects(@"l", [reader processString:@"111000"], @"failed"); - STAssertEqualObjects(@"k", [reader processString:@"101000"], @"failed"); - STAssertEqualObjects(@"o", [reader processString:@"101010"], @"failed"); - STAssertEqualObjects(@"w", [reader processString:@"010111"], @"failed"); - STAssertEqualObjects(@"m", [reader processString:@"101100"], @"failed"); + STAssertEqualObjects(@"a", [reader characterReceived:@"100000"], @"failed"); + STAssertEqualObjects(@"b", [reader characterReceived:@"110000"], @"failed"); + STAssertEqualObjects(@"c", [reader characterReceived:@"100100"], @"failed"); + STAssertEqualObjects(@"l", [reader characterReceived:@"111000"], @"failed"); + STAssertEqualObjects(@"k", [reader characterReceived:@"101000"], @"failed"); + STAssertEqualObjects(@"o", [reader characterReceived:@"101010"], @"failed"); + STAssertEqualObjects(@"w", [reader characterReceived:@"010111"], @"failed"); + STAssertEqualObjects(@"m", [reader characterReceived:@"101100"], @"failed"); STAssertEqualObjects(@"abclkowm", reader.wordTyping, @"did not store word correctly"); - STAssertEqualObjects(@"", [reader processString:ABSpaceCharacter], @"Did not return space"); + STAssertEqualObjects(nil, [reader characterReceived:ABSpaceCharacter], @"Did not return space"); STAssertEqualObjects(@"", reader.wordTyping, @"did not store word correctly"); - + + reader = nil; +} + +- (void)testGradeTwoLookUpInGradeOne +{ + ABBrailleReader *reader = [ABBrailleReader new]; + [reader setGrade:ABGradeOne]; // Attempt grade two lookup - STAssertFalseNoThrow([@"and" isEqualToString:[reader processString:@"111101"]], @"and returned"); - STAssertFalseNoThrow([@"ch" isEqualToString:[reader processString:@"100001"]], @"and returned"); - + STAssertFalseNoThrow([@"and" isEqualToString:[reader characterReceived:@"111101"]], @"and returned"); + STAssertFalseNoThrow([@"ch" isEqualToString:[reader characterReceived:@"100001"]], @"and returned"); reader = nil; } -- (void)testABBrailleReaderGrade2 { +- (void)testABBrailleReaderGrade2_test1 +{ - ABBrailleReader *reader = [[ABBrailleReader alloc] initWithAudioTarget:nil selector:nil]; + ABBrailleReader *reader = [ABBrailleReader new]; // Test grade two [reader setGrade:ABGradeTwo]; // test none grade two lookups - STAssertEqualObjects(@"a", [reader processString:@"100000"], @"failed"); - STAssertEqualObjects(@"b", [reader processString:@"110000"], @"failed"); - STAssertEqualObjects(@"c", [reader processString:@"100100"], @"failed"); - STAssertEqualObjects(@"l", [reader processString:@"111000"], @"failed"); - STAssertEqualObjects(@"k", [reader processString:@"101000"], @"failed"); - STAssertEqualObjects(@"o", [reader processString:@"101010"], @"failed"); - STAssertEqualObjects(@"w", [reader processString:@"010111"], @"failed"); - STAssertEqualObjects(@"m", [reader processString:@"101100"], @"failed"); + STAssertEqualObjects(@"a", [reader characterReceived:@"100000"], @"failed"); + STAssertEqualObjects(@"b", [reader characterReceived:@"110000"], @"failed"); + STAssertEqualObjects(@"c", [reader characterReceived:@"100100"], @"failed"); + STAssertEqualObjects(@"l", [reader characterReceived:@"111000"], @"failed"); + STAssertEqualObjects(@"k", [reader characterReceived:@"101000"], @"failed"); + STAssertEqualObjects(@"o", [reader characterReceived:@"101010"], @"failed"); + STAssertEqualObjects(@"w", [reader characterReceived:@"010111"], @"failed"); + STAssertEqualObjects(@"m", [reader characterReceived:@"101100"], @"failed"); STAssertEqualObjects(@"abclkowm", reader.wordTyping, @"did not store word correctly"); - STAssertEqualObjects(@"", [reader processString:ABSpaceCharacter], @"Did not return space"); + STAssertEqualObjects(nil, [reader characterReceived:ABSpaceCharacter], @"Did not return space"); STAssertEqualObjects(@"", reader.wordTyping, @"did not store word correctly"); + reader = nil; +} + +- (void)testABBrailleReaderGrade2_test2 +{ + ABBrailleReader *reader = [ABBrailleReader new]; // Grade two lookups no options - STAssertEqualObjects(@"and", [reader processString:@"111101"], @"failed"); - STAssertEqualObjects(@"for", [reader processString:@"111111"], @"failed"); - STAssertEqualObjects(@"with", [reader processString:@"011111"], @"failed"); - [reader processString:ABSpaceCharacter]; + STAssertEqualObjects(@"and", [reader characterReceived:@"111101"], @"failed"); + STAssertEqualObjects(@"for", [reader characterReceived:@"111111"], @"failed"); + STAssertEqualObjects(@"with", [reader characterReceived:@"011111"], @"failed"); + [reader characterReceived:ABSpaceCharacter]; STAssertEqualObjects(@"", reader.wordTyping, @"work not cleared"); - + reader = nil; +} + +- (void)testABBrailleReaderGrade2_test3 +{ + ABBrailleReader *reader = [ABBrailleReader new]; // Grade two prefix tests // Test level two lookups // Type phone - [reader processString:@"111100"]; - [reader processString:@"110010"]; - [reader processString:@"000010"]; - [reader processString:@"101010"]; + [reader characterReceived:@"111100"]; + [reader characterReceived:@"110010"]; + [reader characterReceived:@"000010"]; + [reader characterReceived:@"101010"]; STAssertEqualObjects(reader.wordTyping, @"phone", @"failed to type phone"); - [reader processString:ABSpaceCharacter]; - + [reader characterReceived:ABSpaceCharacter]; + reader = nil; +} +- (void)testABBrailleReaderGrade2_test4 +{ + ABBrailleReader *reader = [ABBrailleReader new]; // Test numbers - [reader processString:@"001111"]; - [reader processString:@"100000"]; - [reader processString:@"010110"]; - [reader processString:@"100000"]; - [reader processString:@"100010"]; + [reader characterReceived:@"001111"]; + [reader characterReceived:@"100000"]; + [reader characterReceived:@"010110"]; + [reader characterReceived:@"100000"]; + [reader characterReceived:@"100010"]; STAssertEqualObjects(reader.wordTyping, @"1015", @"failed to handle numbers"); - [reader processString:ABSpaceCharacter]; - + [reader characterReceived:ABSpaceCharacter]; + reader = nil; +} +- (void)testABBrailleReaderGrade2_test5 +{ + ABBrailleReader *reader = [ABBrailleReader new]; // test level three lookup // type manyhadspirit - [reader processString:@"000111"]; - [reader processString:@"101100"]; - [reader processString:@"000111"]; - [reader processString:@"110010"]; - [reader processString:@"000111"]; - [reader processString:@"011100"]; + [reader characterReceived:@"000111"]; + [reader characterReceived:@"101100"]; + [reader characterReceived:@"000111"]; + [reader characterReceived:@"110010"]; + [reader characterReceived:@"000111"]; + [reader characterReceived:@"011100"]; STAssertEqualObjects(reader.wordTyping, @"manyhadspirit", @"failed to type manyhadspirt"); - [reader processString:ABSpaceCharacter]; - + [reader characterReceived:ABSpaceCharacter]; + reader = nil; +} +- (void)testABBrailleReaderGrade2_test6 +{ + ABBrailleReader *reader = [ABBrailleReader new]; // level four // count - [reader processString:@"100100"]; - [reader processString:@"000101"]; - [reader processString:@"011110"]; + [reader characterReceived:@"100100"]; + [reader characterReceived:@"000101"]; + [reader characterReceived:@"011110"]; STAssertEqualObjects(reader.wordTyping, @"count", @"failed to type count"); - [reader processString:ABSpaceCharacter]; - + [reader characterReceived:ABSpaceCharacter]; reader = nil; } -- (void)testABBrailleReaderGrade2_test2 +- (void)testABBrailleReaderGrade2_test7 { - ABBrailleReader *reader = [[ABBrailleReader alloc] initWithAudioTarget:nil selector:nil]; - + ABBrailleReader *reader = [ABBrailleReader new]; // Prefix followed by non recongnized post - [reader processString:@"000010"]; - [reader processString:@"100000"]; + [reader characterReceived:@"000010"]; + [reader characterReceived:@"100000"]; // Check should have typed nothing STAssertEqualObjects(reader.wordTyping, @"", @"Char was typed that shouldn't have"); - [reader processString:@"100000"]; + [reader characterReceived:@"100000"]; // An A should have been typed STAssertEqualObjects(reader.wordTyping, @"a", @"An A should have been typed"); - reader = nil; } +- (void)testCapsMethod +{ + NSString *string = @"test"; + string = [NSString stringWithFormat:@"%@%@", [[string substringToIndex:1] uppercaseString], [string substringFromIndex:1]]; + STAssertEqualObjects(string, @"Test", @"Did not caps"); +} + +- (void)testABKeyboardTyping_test1 +{ + ABKeyboard *keyboard = [[ABKeyboard alloc] initWithDelegate:nil]; + ABBrailleReader *reader = keyboard.brailleReader; + UITextView *output = [UITextView new]; + [keyboard setOutput:output]; + + [reader characterReceived:@"101100"]; + [reader characterReceived:@"101111"]; + [reader characterReceived:ABSpaceCharacter]; + [reader characterReceived:@"111100"]; + [reader characterReceived:@"110010"]; + [reader characterReceived:@"000010"]; + [reader characterReceived:@"101010"]; + [reader characterReceived:ABSpaceCharacter]; + + STAssertEqualObjects(output.text, @"my phone ", @"Did not type to output correctly"); +} + +- (void)testABKeyboardTyping_test2 +{ + ABKeyboard *keyboard = [[ABKeyboard alloc] initWithDelegate:nil]; + ABBrailleReader *reader = keyboard.brailleReader; + UITextView *output = [UITextView new]; + [keyboard setOutput:output]; + + [reader characterReceived:@"101100"]; + [reader characterReceived:@"101111"]; + [reader characterReceived:ABSpaceCharacter]; + [reader characterReceived:@"111100"]; + [reader characterReceived:@"110010"]; + [reader characterReceived:@"000010"]; + [reader characterReceived:@"101010"]; + [reader characterReceived:ABSpaceCharacter]; + [reader characterReceived:ABBackspace]; + [reader characterReceived:ABBackspace]; + [reader characterReceived:ABBackspace]; + [reader characterReceived:ABBackspace]; + + STAssertEqualObjects(output.text, @"my ph", @"Did not type to output correctly"); + +} + @end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/ABKeyboard b/AccessBraille/Products/ABKeyboard.framework/Versions/1/ABKeyboard index fc7e944..16d8c37 100644 Binary files a/AccessBraille/Products/ABKeyboard.framework/Versions/1/ABKeyboard and b/AccessBraille/Products/ABKeyboard.framework/Versions/1/ABKeyboard differ diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABActivateKeyboardGestureRecognizer.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABActivateKeyboardGestureRecognizer.h new file mode 100644 index 0000000..3a95b87 --- /dev/null +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABActivateKeyboardGestureRecognizer.h @@ -0,0 +1,32 @@ +// +// ABActivateKeyboardGestureRecognizer.h +// AccessBraille +// +// Created by Michael Timbrook on 3/12/13. +// Copyright (c) 2013 RIT. All rights reserved. +// + +#import "ABTypes.h" + +@protocol ABGestureRecognizerDelegate + +@required + +/* Gives the information about the touch locations for the keyboard */ +- (void)touchColumns:(ABVector[])vectors withInfo:(NSDictionary *)info; + +@end + +@interface ABActivateKeyboardGestureRecognizer : UIGestureRecognizer + +/* State Properties */ +@property (nonatomic) ABGestureDirection activateDirection; +@property (nonatomic) float translationFromStart; + +/* Delegate for ABGestureRecognizer */ +@property (strong, nonatomic) id touchDelegate; + +/* Stops the gesture recognition and starts the keyboard area parsing */ +- (void)getTouchInfo; + +@end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABBrailleReader.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABBrailleReader.h new file mode 100644 index 0000000..014d726 --- /dev/null +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABBrailleReader.h @@ -0,0 +1,35 @@ +// +// ABBrailleReader.h +// AccessBraille +// +// Created by Michael Timbrook on 4/8/13. +// Copyright (c) 2013 RIT. All rights reserved. +// + +#import "ABTouchLayer.h" +#import "ABKeyboard.h" + +// Prefix constants +static NSString *const ABPrefixLevelOne = @"001111"; +static NSString *const ABPrefixNumber = @"001111"; // Level one and number are interchangable +static NSString *const ABPrefixLevelTwo = @"000010"; +static NSString *const ABPrefixLevelThree = @"000111"; +static NSString *const ABPrefixLevelFour = @"000101"; +static NSString *const ABPrefixLevelFive = @"000011"; +static NSString *const ABPrefixLevelSix = @"000001"; +static NSString *const ABPrefixLevelSeven = @"000110"; + +@interface ABBrailleReader : NSObject + ++ (NSString *)brailleStringFromTouchIDs:(NSArray *)touchIDs; +- (NSString *)characterReceived:(NSString *)brailleString; +- (id)initWithAudioTarget:(id)target selector:(SEL)selector; +- (NSString *)processString:(NSString *)brailleString; + +@property (nonatomic) id delegate; +@property (nonatomic) ABKeyboard *keyboardInterface; +@property (weak) ABTouchLayer *layer; +@property (nonatomic) NSString *wordTyping; +@property (nonatomic) UITextView *fieldOutput; +@property (nonatomic) ABGrade grade; +@end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABKeyboard.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABKeyboard.h index af479ed..2963b4c 100644 --- a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABKeyboard.h +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABKeyboard.h @@ -31,7 +31,7 @@ @property (strong, nonatomic) UITextView *output; /* Delegate */ -@property (strong, nonatomic) id delegate; +@property (strong, nonatomic) UIViewController *delegate; /* Access the Gesture */ @property (strong, nonatomic) ABActivateKeyboardGestureRecognizer *keyboardGesture; @@ -45,6 +45,9 @@ /* Set sounds enabled */ @property BOOL sound; +/* Set keyboard grade */ +@property (assign) ABGrade grade; + /* Keyboard state properites */ @property SEL activeKeyboard; @property id activeTarget; @@ -56,6 +59,7 @@ - (id)initWithDelegate:(id)delegate; /* Basic Speaking Method */ +// TODO part of ABSpeak rework to singlton instance, use new contructor format - (void)startSpeakingString:(NSString *)string; /* Keyboard state callbacks */ diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABSpeak.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABSpeak.h index 6ab615c..7c97b82 100644 --- a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABSpeak.h +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABSpeak.h @@ -18,8 +18,6 @@ #import #import -// TODO add documentation - @interface ABSpeak : NSObject { FliteController *fliteController; Slt *slt; @@ -28,10 +26,11 @@ @property (strong, nonatomic) FliteController *fliteController; @property (strong, nonatomic) Slt *slt; +/* Use this to get the current active instance of ABSpeak, if one does not exist it will be created for you */ + (instancetype)sharedInstance; +/* Start/Stop speaking strings */ - (void)speakString:(NSString *)string; - (void)stopSpeaking; - @end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABTypes.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABTypes.h new file mode 100644 index 0000000..d194d47 --- /dev/null +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Headers/ABTypes.h @@ -0,0 +1,47 @@ +// +// ABTypes.h +// AccessBraille +// +// Created by Michael Timbrook on 3/29/13. +// Copyright (c) 2013 RIT. All rights reserved. +// + +/* Defines the gestures direction to work for both activation and deactivation */ +typedef enum ABGestureDirection : NSUInteger ABGestureDirection; +enum ABGestureDirection : NSUInteger { + ABGestureDirectionUP, + ABGestureDirectionDOWN +}; + +typedef enum ABGrade : NSUInteger ABGrade; +enum ABGrade : NSUInteger { + ABGradeOne, + ABGradeTwo +}; + +/* String Constansts for keys in info dictionary */ +static NSString *const ABGestureInfoStatus = @"ABGestureInfoStatus"; +static NSString *const ABSpaceTyped = @"ABSpaceTyped"; +static NSString *const ABBackspaceReceived = @"ABBackspaceTyped"; + +/* String Space Constant */ +static NSString *const ABSpaceCharacter = @"(SPACE)"; +static NSString *const ABBackspace = @"(BACKSPACE)"; + +/* Audio Constants */ +static NSString *const ABBackspaceSound = @"BS"; +static NSString *const ABEnableSound = @"ES"; +static NSString *const ABDisableSound = @"DS"; + +/* ABVector */ +typedef struct { + CGPoint start; + CGPoint end; + double angle; +} ABVector; + +/* Creates an ABVector from two CGPoints */ +ABVector ABVectorMake(CGPoint start, CGPoint end); + +/* Returns a printable vertion of an ABVector array */ +NSString* ABVectorPrintable(ABVector vectors[]); diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/Info.plist b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/Info.plist index 7a26808..1972103 100644 Binary files a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/Info.plist and b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/Info.plist differ diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/ABTouchLayer.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/ABTouchLayer.h new file mode 100644 index 0000000..8777432 --- /dev/null +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/ABTouchLayer.h @@ -0,0 +1,31 @@ +// +// ABTouchLayer.h +// AccessBraille +// +// Created by Michael Timbrook on 4/4/13. +// Copyright (c) 2013 RIT. All rights reserved. +// + +#import "ABTypes.h" +#import "ABTouchView.h" +#import + +@protocol ABTouchReciever +@required +- (void)characterReceived:(NSString *)brailleString; +@end + +@interface ABTouchLayer : UIView + +- (void)resetView; +- (void)subViewsAdded; + +@property BOOL shift; +@property BOOL caps; + +/* Set sounds enabled */ +@property BOOL sound; + +@property (nonatomic) id delegate; +@property int ajt; +@end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/ABTouchView.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/ABTouchView.h new file mode 100644 index 0000000..1268776 --- /dev/null +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/ABTouchView.h @@ -0,0 +1,25 @@ +// +// ABTouchView.h +// AccessBraille +// +// Created by Michael Timbrook on 4/5/13. +// Copyright (c) 2013 RIT. All rights reserved. +// + +@protocol ABTouchColumn +@required +/* Sends touch interface to ABTouchLayer to be processed */ +- (void)touchWithId:(NSInteger)tapID tap:(BOOL)tapped; +- (CGPoint)locationInDelegate:(UITapGestureRecognizer *)reg; +- (float)averageY; +- (void)updateYAverage:(float)newPoint; +- (void)space; + +@end + +@interface ABTouchView : UIView + +/* Delegate */ +@property id delegate; + +@end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/UITextView+simpleadd.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/UITextView+simpleadd.h new file mode 100644 index 0000000..8102cea --- /dev/null +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/UITextView+simpleadd.h @@ -0,0 +1,16 @@ +// +// UITextField+simpleadd.h +// AccessBraille +// +// Created by Michael Timbrook on 6/24/13. +// Copyright (c) 2013 RIT. All rights reserved. +// + +#import + +@interface UITextView (simpleadd) + +- (void)replaceLastWordWithString:(NSString *)string; +- (NSArray *)arrayOfWordsFromSentence:(NSString *)sentence; + +@end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/UIView+quickRemove.h b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/UIView+quickRemove.h new file mode 100644 index 0000000..f501cd3 --- /dev/null +++ b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/PrivateHeaders/UIView+quickRemove.h @@ -0,0 +1,16 @@ +// +// UIView+quickRemove.h +// AccessBraille +// +// Created by Michael Timbrook on 5/28/13. +// Copyright (c) 2013 RIT. All rights reserved. +// + +#import + +@interface UIView (quickRemove) + +/* Removes all subviews from a view */ +- (void)removeSubviews; + +@end diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/disableCapsSound.aiff b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/disableCapsSound.aiff new file mode 100644 index 0000000..483fcb0 Binary files /dev/null and b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/disableCapsSound.aiff differ diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/enableCapsSound.aiff b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/enableCapsSound.aiff new file mode 100644 index 0000000..b77c9c7 Binary files /dev/null and b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/enableCapsSound.aiff differ diff --git a/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/lockCapsSound.aiff b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/lockCapsSound.aiff new file mode 100644 index 0000000..a4cf6c9 Binary files /dev/null and b/AccessBraille/Products/ABKeyboard.framework/Versions/1/Resources/lockCapsSound.aiff differ