diff --git a/CHANGES.md b/CHANGES.md index 74a06990..04c94489 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,15 @@ +3.4.0 (2022-08-17) +--- + +Improvements: + +- Remove most of the deprecated methods with exception of delegates +- Fix missing NS_DESIGNATED_INITIALIZER + +Fixes: + +- Fix incorrect comparison of style image cache keys that led to 100% miss by [@ninjaprox](https://github.com/ninjaprox) + 3.3.0 (2020-07-12) --- diff --git a/README.md b/README.md index 54383f69..47391899 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![CocoaPods Compatible](https://img.shields.io/badge/CocoaPods-Compatible%201.8+-success.svg)](https://cocoapods.org/pods/ShortcutRecorder) [![Carthage Compatible](https://img.shields.io/badge/Carthage-Compatible-success.svg)](https://github.com/Carthage/Carthage) +[![SPM Compatible](https://img.shields.io/badge/SPM-Compatible-success.svg)](https://swiftpackageindex.com/Kentzo/ShortcutRecorder) [![Coverage](https://codecov.io/gh/Kentzo/ShortcutRecorder/branch/master/graph/badge.svg)](https://codecov.io/gh/Kentzo/ShortcutRecorder) [![Build Status](https://travis-ci.org/Kentzo/ShortcutRecorder.svg?branch=master)](https://travis-ci.org/Kentzo/ShortcutRecorder) @@ -86,15 +87,15 @@ The framework supports [module maps](https://clang.llvm.org/docs/Modules.html), ### Swift Package Manager - .package(url: "git://github.com/Kentzo/ShortcutRecorder.git", from: "3.3.0") + .package(url: "git://github.com/Kentzo/ShortcutRecorder.git", from: "3.4.0") ### CocoaPods - pod 'ShortcutRecorder', '~> 3.3.0' + pod 'ShortcutRecorder', '~> 3.4.0' ### Carthage - github "Kentzo/ShortcutRecorder" ~> 3.3.0 + github "Kentzo/ShortcutRecorder" ~> 3.4.0 Prebuilt frameworks are available via GitHub releases. diff --git a/ShortcutRecorder.xcodeproj/project.pbxproj b/ShortcutRecorder.xcodeproj/project.pbxproj index 3d0b1f14..6035c49e 100644 --- a/ShortcutRecorder.xcodeproj/project.pbxproj +++ b/ShortcutRecorder.xcodeproj/project.pbxproj @@ -645,7 +645,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 3.1; - DYLIB_CURRENT_VERSION = 3.3; + DYLIB_CURRENT_VERSION = 3.4; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Sources/ShortcutRecorder/Info.plist; INSTALL_PATH = "@rpath"; @@ -672,7 +672,7 @@ COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 3.1; - DYLIB_CURRENT_VERSION = 3.3; + DYLIB_CURRENT_VERSION = 3.4; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Sources/ShortcutRecorder/Info.plist; INSTALL_PATH = "@rpath"; diff --git a/Sources/ShortcutRecorder/Info.plist b/Sources/ShortcutRecorder/Info.plist index 85f89fbb..74251f1e 100644 --- a/Sources/ShortcutRecorder/Info.plist +++ b/Sources/ShortcutRecorder/Info.plist @@ -13,11 +13,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.3.0 + 3.4.0 CFBundleSignature ???? CFBundleVersion - 3.3.0 + 3.4.0 NSHumanReadableCopyright Copyright © 2019 ShortcutRecorder attributors diff --git a/Sources/ShortcutRecorder/Resources/ca.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/ca.lproj/ShortcutRecorder.strings index 30209352..0b5bbe5f 100644 --- a/Sources/ShortcutRecorder/Resources/ca.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/ca.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Drecera"; /* VoiceOver value for the value-less control */ -"Empty" = "Buida"; +"Not set" = "Sense definir"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Utilitza la drecera antiga"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Elimineu la drecera actual"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Determina drecera"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Prémer tecles ara"; /* Label for the value-less control */ "Record Shortcut" = "Gravar drecera"; diff --git a/Sources/ShortcutRecorder/Resources/cs.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/cs.lproj/ShortcutRecorder.strings index 670748ab..a31e3977 100644 --- a/Sources/ShortcutRecorder/Resources/cs.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/cs.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Kl. Zkratku"; /* VoiceOver value for the value-less control */ -"Empty" = "Prázdné"; +"Not set" = "Nenastaveno"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Použít starou kl. zkratku"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Odstranit aktuální kl. zkratku"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Zadejte kl. zkratku"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Stiskněte klávesy"; /* Label for the value-less control */ "Record Shortcut" = "Nahrát kl. zkratku"; diff --git a/Sources/ShortcutRecorder/Resources/de.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/de.lproj/ShortcutRecorder.strings index 66b35585..de963187 100644 --- a/Sources/ShortcutRecorder/Resources/de.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/de.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Tastaturkurzbefehl"; /* VoiceOver value for the value-less control */ -"Empty" = "Leer"; +"Not set" = "Keine Angabe"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Alten Kurzbefehl benutzen"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Aktuellen Kurzbefehl löschen"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Kurzbefehl eingeben"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Tasten jetzt drücken"; /* Label for the value-less control */ "Record Shortcut" = "Kurzbefehl aufnehmen"; diff --git a/Sources/ShortcutRecorder/Resources/el.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/el.lproj/ShortcutRecorder.strings index 7a3dcdc0..d1b1125a 100644 --- a/Sources/ShortcutRecorder/Resources/el.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/el.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Συντόμευσης"; /* VoiceOver value for the value-less control */ -"Empty" = "Κενό"; +"Not set" = "Κενό"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Χρήση παλιάς συντόμευσης"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Διαγραφή τρέχουσας συντομεύσεως"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Εισαγωγή συντόμευσης"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Εισαγωγή συντόμευσης"; /* Label for the value-less control */ "Record Shortcut" = "Εγγραφή Συντόμευσης"; diff --git a/Sources/ShortcutRecorder/Resources/en.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/en.lproj/ShortcutRecorder.strings index d745f714..1f534212 100644 --- a/Sources/ShortcutRecorder/Resources/en.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/en.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Shortcut"; /* VoiceOver value for the value-less control */ -"Empty" = "Empty"; +"Not set" = "Not set"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Use old shortcut"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Delete current shortcut"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Type shortcut"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Press keys now"; /* Label for the value-less control */ "Record Shortcut" = "Record Shortcut"; diff --git a/Sources/ShortcutRecorder/Resources/es.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/es.lproj/ShortcutRecorder.strings index 65c38395..3edec623 100644 --- a/Sources/ShortcutRecorder/Resources/es.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/es.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Función rápida"; /* VoiceOver value for the value-less control */ -"Empty" = "Vacío"; +"Not set" = "Sin definir"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Usar la anterior función rápida"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Eliminar la actual función rápida"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Teclear función rápida"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Pulsa las teclas ahora"; /* Label for the value-less control */ "Record Shortcut" = "Grabar función rápida"; diff --git a/Sources/ShortcutRecorder/Resources/fr.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/fr.lproj/ShortcutRecorder.strings index 6ae3c85f..4c73d5a7 100644 --- a/Sources/ShortcutRecorder/Resources/fr.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/fr.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Raccourci"; /* VoiceOver value for the value-less control */ -"Empty" = "Vide"; +"Not set" = "Non défini"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Utiliser l’ancien raccourci"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Supprimer le raccourci actuel"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Taper le raccourci"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Taper le raccourci"; /* Label for the value-less control */ "Record Shortcut" = "Enregistrer le raccourci"; diff --git a/Sources/ShortcutRecorder/Resources/it.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/it.lproj/ShortcutRecorder.strings index 0446829f..18558f27 100644 --- a/Sources/ShortcutRecorder/Resources/it.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/it.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Abbreviazione"; /* VoiceOver value for the value-less control */ -"Empty" = "Vuota"; +"Not set" = "Non impostato"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Usa vecchia abbreviazione"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Elimina l'abbreviazione corrente"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Digita abbreviazione"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Premi tasti adesso"; /* Label for the value-less control */ "Record Shortcut" = "Registra abbreviazione"; diff --git a/Sources/ShortcutRecorder/Resources/ja.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/ja.lproj/ShortcutRecorder.strings index 1b32ffc7..17dd02a8 100644 --- a/Sources/ShortcutRecorder/Resources/ja.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/ja.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "ショートカット"; /* VoiceOver value for the value-less control */ -"Empty" = "空の"; +"Not set" = "未設定"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "古いショートカット設定を使用"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "現在のショートカットを削除"; -/* Tooltip for the recording mode */ -"Type shortcut" = "ショートカットを入力してください"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "今すぐキーを押してください"; /* Label for the value-less control */ "Record Shortcut" = "ショートカットを入力"; diff --git a/Sources/ShortcutRecorder/Resources/ko.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/ko.lproj/ShortcutRecorder.strings index dd732abb..30d77aad 100644 --- a/Sources/ShortcutRecorder/Resources/ko.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/ko.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "단축키"; /* VoiceOver value for the value-less control */ -"Empty" = "비어 있음"; +"Not set" = "설정 안 됨"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "예전 단축키 사용"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "현재 단축키 삭제"; -/* Tooltip for the recording mode */ -"Type shortcut" = "단축키 입력"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "지금 키 입력"; /* Label for the value-less control */ "Record Shortcut" = "단축키 입력"; diff --git a/Sources/ShortcutRecorder/Resources/nb.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/nb.lproj/ShortcutRecorder.strings index aba37e98..e5eff683 100644 --- a/Sources/ShortcutRecorder/Resources/nb.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/nb.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Snarvei"; /* VoiceOver value for the value-less control */ -"Empty" = "Tomt"; +"Not set" = "Ikke angitt"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Bruk forrige snarvei"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Slett gjeldende snarvei"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Trykk snarvei"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Trykk på taster nå"; /* Label for the value-less control */ "Record Shortcut" = "Spill inn snarvei"; diff --git a/Sources/ShortcutRecorder/Resources/nl.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/nl.lproj/ShortcutRecorder.strings index 03264ad2..9bf24086 100644 --- a/Sources/ShortcutRecorder/Resources/nl.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/nl.lproj/ShortcutRecorder.strings @@ -1,11 +1,11 @@ /* Literal for the Space key */ -"Space" = "Spatiebalk"; +"Space" = "Spatie"; /* VoiceOver type of the object recorded by the control */ "Shortcut" = "Toetscombinatie"; /* VoiceOver value for the value-less control */ -"Empty" = "Leeg"; +"Not set" = "Niet ingesteld"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Gebruik vorige toetscombinatie"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Huidige toetscombinatie verwijderen"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Druk toetscombinatie in"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Druk nu op toetsen"; /* Label for the value-less control */ "Record Shortcut" = "Toetscombinatie opnemen"; diff --git a/Sources/ShortcutRecorder/Resources/pl.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/pl.lproj/ShortcutRecorder.strings index 1f40db77..378c5f44 100644 --- a/Sources/ShortcutRecorder/Resources/pl.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/pl.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Skrót"; /* VoiceOver value for the value-less control */ -"Empty" = "Pusty"; +"Not set" = "Nie ustawiono"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Użyj starego skrótu"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Skasuj bieżącym skrót"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Podaj skrót"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Naciśnij klawisze teraz"; /* Label for the value-less control */ "Record Shortcut" = "Utwórz skrót"; diff --git a/Sources/ShortcutRecorder/Resources/pt-BR.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/pt-BR.lproj/ShortcutRecorder.strings index c872ba8e..b9e6aca1 100644 --- a/Sources/ShortcutRecorder/Resources/pt-BR.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/pt-BR.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Atalho"; /* VoiceOver value for the value-less control */ -"Empty" = "Vazia"; +"Not set" = "Não Definido"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Usar atalho antigo"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Apagar atalho atual"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Digite atalho"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Pressione as teclas agora"; /* Label for the value-less control */ "Record Shortcut" = "Gravar Atalho"; diff --git a/Sources/ShortcutRecorder/Resources/pt.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/pt.lproj/ShortcutRecorder.strings index b9bfc6f4..85986d16 100644 --- a/Sources/ShortcutRecorder/Resources/pt.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/pt.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Atalho"; /* VoiceOver value for the value-less control */ -"Empty" = "Vazia"; +"Not set" = "Por definir"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Usar atalho antigo"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Apagar atalho atual"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Digitar atalho"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Premir teclas agora"; /* Label for the value-less control */ "Record Shortcut" = "Gravar Atalho"; diff --git a/Sources/ShortcutRecorder/Resources/ro.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/ro.lproj/ShortcutRecorder.strings index 4f4fd6c1..436d40ae 100644 --- a/Sources/ShortcutRecorder/Resources/ro.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/ro.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Scurtătură"; /* VoiceOver value for the value-less control */ -"Empty" = "Gol"; +"Not set" = "Neconfigurat"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Folosește vechea scurtătură"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Ștergeți scurtătură curente"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Tastează scurtătură"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Apăsați tastele acum"; /* Label for the value-less control */ "Record Shortcut" = "Înregistra scurtătură"; diff --git a/Sources/ShortcutRecorder/Resources/ru.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/ru.lproj/ShortcutRecorder.strings index 0aea0e6c..912ac17e 100644 --- a/Sources/ShortcutRecorder/Resources/ru.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/ru.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Сочетание Клавиш"; /* VoiceOver value for the value-less control */ -"Empty" = "Пусто"; +"Not set" = "Не задано"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Использовать предыдущее сочетание клавиш"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Удалить текущее сочетание клавиш"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Введите сочетание клавиш"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Нажмите клавиши"; /* Label for the value-less control */ "Record Shortcut" = "Ввести сочетание клавиш"; diff --git a/Sources/ShortcutRecorder/Resources/sk.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/sk.lproj/ShortcutRecorder.strings index 8fa860fc..41fb1d1c 100644 --- a/Sources/ShortcutRecorder/Resources/sk.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/sk.lproj/ShortcutRecorder.strings @@ -1,11 +1,11 @@ /* Literal for the Space key */ -"Space" = "Medzera"; +"Space" = "Medzerník"; /* VoiceOver type of the object recorded by the control */ "Shortcut" = "Skratku"; /* VoiceOver value for the value-less control */ -"Empty" = "Prázdny"; +"Not set" = "Nenastavený"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Použiť pôvodnú skratku"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Odstrániť aktuálne skratku"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Napísať skratku"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Stlačte klávesy"; /* Label for the value-less control */ "Record Shortcut" = "Nahrať skratku"; diff --git a/Sources/ShortcutRecorder/Resources/sv.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/sv.lproj/ShortcutRecorder.strings index 78ec4e3e..06f57c7a 100644 --- a/Sources/ShortcutRecorder/Resources/sv.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/sv.lproj/ShortcutRecorder.strings @@ -5,7 +5,7 @@ "Shortcut" = "Kortkommando"; /* VoiceOver value for the value-less control */ -"Empty" = "Tom"; +"Not set" = "Ej inställt"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "Behåll kortkommando"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "Radera nuvarande kortkommando"; -/* Tooltip for the recording mode */ -"Type shortcut" = "Tryck kortkommando"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "Tryck ned tangenter nu"; /* Label for the value-less control */ "Record Shortcut" = "Registrera kortkommando"; diff --git a/Sources/ShortcutRecorder/Resources/th.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/th.lproj/ShortcutRecorder.strings index 66fd485b..c05edc59 100644 --- a/Sources/ShortcutRecorder/Resources/th.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/th.lproj/ShortcutRecorder.strings @@ -1,11 +1,11 @@ /* Literal for the Space key */ -"Space" = "วรรค"; +"Space" = "Space"; /* VoiceOver type of the object recorded by the control */ "Shortcut" = "ปุ่มลัด"; /* VoiceOver value for the value-less control */ -"Empty" = "ว่างเปล่า"; +"Not set" = "ไม่ได้ระบุ"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "ใช้ปุ่มลัดเดิม"; @@ -16,8 +16,8 @@ /* Tooltip for the clear button */ "Delete current shortcut" = "ลบปุ่มลัดปัจจุบัน"; -/* Tooltip for the recording mode */ -"Type shortcut" = "พิมพ์ปุ่มลัด"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "กดปุ่มตอนนี้"; /* Label for the value-less control */ "Record Shortcut" = "บันทึกปุ่มลัด"; diff --git a/Sources/ShortcutRecorder/Resources/zh-Hans.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/zh-Hans.lproj/ShortcutRecorder.strings index 35596de6..7d33d614 100644 --- a/Sources/ShortcutRecorder/Resources/zh-Hans.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/zh-Hans.lproj/ShortcutRecorder.strings @@ -1,44 +1,44 @@ /* Literal for the Space key */ -"Space" = "空格"; +"Space" = "空格键"; /* VoiceOver type of the object recorded by the control */ "Shortcut" = "快捷键"; /* VoiceOver value for the value-less control */ -"Empty" = "空"; +"Not set" = "未设定"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "使用原来的快捷键"; /* Tooltip for the cancel button when the control has no value */ -"Cancel recording" = "取消录音"; +"Cancel recording" = "取消录制"; /* Tooltip for the clear button */ "Delete current shortcut" = "删除当前快捷键"; -/* Tooltip for the recording mode */ -"Type shortcut" = "输入快捷键"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "现在按下按键"; /* Label for the value-less control */ -"Record Shortcut" = "记录快捷键"; +"Record Shortcut" = "录制快捷键"; /* Tooltip for the normal mode */ -"Click to record shortcut" = "点击记录快捷键"; +"Click to record shortcut" = "点按以录制快捷键"; /* Value for the NSLocalizedFailureReasonErrorKey key of validator's error */ -"The \"%@\" shortcut can't be used!" = "无法使用快捷键组合%@!"; +"The \"%@\" shortcut can't be used!" = "无法使用快捷键“%@”!"; /* Value for the NSLocalizedDescriptionKey key of validator's delegate error */ -"The \"%@\" shortcut can't be used because %@." = "无法使用快捷键组合%@,因为%@。"; +"The \"%@\" shortcut can't be used because %@." = "无法使用快捷键“%@”,因为%@。"; /* Default value for the NSLocalizedDescriptionKey key of validator's error */ -"The \"%@\" shortcut is already in use." = "快捷键组合 “%@” 已经被使用。"; +"The \"%@\" shortcut is already in use." = "快捷键“%@”已经被使用。"; /* Value for the NSLocalizedDescriptionKey key of validator's system shortcuts error */ -"The \"%@\" shortcut can't be used because it's already used by a system-wide keyboard shortcut. If you really want to use this shortcut, most shortcuts can be changed in the Keyboard panel in System Preferences." = "无法使用快捷键组合%@,因为已用作系统级快捷键。(如果您确定要使用该快捷键,大部分快捷键可以在系统偏好设置的键盘和鼠标面板)"; +"The \"%@\" shortcut can't be used because it's already used by a system-wide keyboard shortcut. If you really want to use this shortcut, most shortcuts can be changed in the Keyboard panel in System Preferences." = "快捷键“%@”已经被系统或另一个应用程序使用。请选取另一个快捷键或使用“键盘偏好设置”来自定其他的系统快捷键。"; /* Value for the NSLocalizedDescriptionKey key of validator's menu error */ -"The \"%@\" shortcut can't be used because it's already used by the \"%@\" menu item." = "无法使用快捷键组合%@,因为已用于菜单项%@。"; +"The \"%@\" shortcut can't be used because it's already used by the \"%@\" menu item." = "无法使用快捷键“%@”,因为已用于菜单项“%@”。"; /* Accessibility name of the Command modifier key */ "Command" = "Command"; diff --git a/Sources/ShortcutRecorder/Resources/zh-Hant.lproj/ShortcutRecorder.strings b/Sources/ShortcutRecorder/Resources/zh-Hant.lproj/ShortcutRecorder.strings index 79ff0525..0d7b0b4a 100644 --- a/Sources/ShortcutRecorder/Resources/zh-Hant.lproj/ShortcutRecorder.strings +++ b/Sources/ShortcutRecorder/Resources/zh-Hant.lproj/ShortcutRecorder.strings @@ -5,40 +5,40 @@ "Shortcut" = "快速鍵"; /* VoiceOver value for the value-less control */ -"Empty" = "無內容"; +"Not set" = "未設定"; /* Tooltip for the cancel button when the control has a value */ "Use old shortcut" = "使用舊的快速鍵"; /* Tooltip for the cancel button when the control has no value */ -"Cancel recording" = "取消錄音"; +"Cancel recording" = "取消記錄"; /* Tooltip for the clear button */ "Delete current shortcut" = "刪除當前快速鍵"; -/* Tooltip for the recording mode */ -"Type shortcut" = "輸入快速鍵"; +/* Label and tooltip for the recording mode */ +"Press keys now" = "現在按下按鍵"; /* Label for the value-less control */ "Record Shortcut" = "記錄快速鍵"; /* Tooltip for the normal mode */ -"Click to record shortcut" = "點擊以記錄快速鍵"; +"Click to record shortcut" = "按一下來記錄快速鍵"; /* Value for the NSLocalizedFailureReasonErrorKey key of validator's error */ -"The \"%@\" shortcut can't be used!" = "無法使用快速鍵組合 %@!"; +"The \"%@\" shortcut can't be used!" = "無法使用快速鍵「%@」!"; /* Value for the NSLocalizedDescriptionKey key of validator's delegate error */ -"The \"%@\" shortcut can't be used because %@." = "無法使用快速鍵組合 \"%@\",因為 %@。"; +"The \"%@\" shortcut can't be used because %@." = "無法使用快速鍵「%@」,因為%@。"; /* Default value for the NSLocalizedDescriptionKey key of validator's error */ -"The \"%@\" shortcut is already in use." = "快速鍵組合 “%@” 已經被使用。"; +"The \"%@\" shortcut is already in use." = "快速鍵「%@」已經被使用。"; /* Value for the NSLocalizedDescriptionKey key of validator's system shortcuts error */ -"The \"%@\" shortcut can't be used because it's already used by a system-wide keyboard shortcut. If you really want to use this shortcut, most shortcuts can be changed in the Keyboard panel in System Preferences." = "無法使用快速鍵組合 \"%@\",因為已被系統層級快速鍵使用。(如果您確認要使用該快速鍵組合,大部分快速鍵可以在系統偏好設定的鍵盤與滑鼠面板中變更。)"; +"The \"%@\" shortcut can't be used because it's already used by a system-wide keyboard shortcut. If you really want to use this shortcut, most shortcuts can be changed in the Keyboard panel in System Preferences." = "快速鍵「%@」正由系統或其他應用程式使用中。請選擇其他快速鍵或使用「鍵盤」偏好設定來自訂另外的系統快速鍵。"; /* Value for the NSLocalizedDescriptionKey key of validator's menu error */ -"The \"%@\" shortcut can't be used because it's already used by the \"%@\" menu item." = "無法使用快速鍵組合 \"%@\",因為已被選單項目 \"%@\" 使用。"; +"The \"%@\" shortcut can't be used because it's already used by the \"%@\" menu item." = "無法使用快速鍵「%@」,因為已被選單項目「%@」使用。"; /* Accessibility name of the Command modifier key */ "Command" = "Command"; diff --git a/Sources/ShortcutRecorder/SRKeyCodeTransformer.m b/Sources/ShortcutRecorder/SRKeyCodeTransformer.m index e9a6c9dd..925ffd96 100644 --- a/Sources/ShortcutRecorder/SRKeyCodeTransformer.m +++ b/Sources/ShortcutRecorder/SRKeyCodeTransformer.m @@ -347,7 +347,10 @@ @implementation SRKeyCodeTransformer - (instancetype)init { if (self.class == SRKeyCodeTransformer.class) + { + os_trace_error("#Developer #Error Use SRSymbolicKeyCodeTransformer instead"); return SRSymbolicKeyCodeTransformer.sharedTransformer; + } else return [super init]; } @@ -355,7 +358,10 @@ - (instancetype)init - (instancetype)initWithInputSource:(id)anInputSource { if (self.class == SRKeyCodeTransformer.class) + { + os_trace_error("#Developer #Error Use SRSymbolicKeyCodeTransformer instead"); return [[SRSymbolicKeyCodeTransformer alloc] initWithInputSource:anInputSource]; + } else { self = [super init]; @@ -701,180 +707,6 @@ - (NSString *)transformedValue:(NSNumber *)aValue return nil; } -#pragma mark Deprecated - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" - -+ (instancetype)sharedASCIITransformer -{ - return SRASCIISymbolicKeyCodeTransformer.sharedTransformer; -} - -+ (instancetype)sharedPlainTransformer -{ - return SRLiteralKeyCodeTransformer.sharedTransformer; -} - -+ (SRKeyCodeTransformer *)sharedPlainASCIITransformer -{ - return SRASCIILiteralKeyCodeTransformer.sharedTransformer; -} - -+ (NSDictionary *)specialKeyCodeToSymbolMapping -{ - // Most of these keys are system constans. - // Values for rest of the keys were given by setting key equivalents in IB. - static NSDictionary *Mapping = nil; - static dispatch_once_t OnceToken; - dispatch_once(&OnceToken, ^{ - Mapping = @{ - @(SRKeyCodeF1): SRUnicharToString(NSF1FunctionKey), - @(SRKeyCodeF2): SRUnicharToString(NSF2FunctionKey), - @(SRKeyCodeF3): SRUnicharToString(NSF3FunctionKey), - @(SRKeyCodeF4): SRUnicharToString(NSF4FunctionKey), - @(SRKeyCodeF5): SRUnicharToString(NSF5FunctionKey), - @(SRKeyCodeF6): SRUnicharToString(NSF6FunctionKey), - @(SRKeyCodeF7): SRUnicharToString(NSF7FunctionKey), - @(SRKeyCodeF8): SRUnicharToString(NSF8FunctionKey), - @(SRKeyCodeF9): SRUnicharToString(NSF9FunctionKey), - @(SRKeyCodeF10): SRUnicharToString(NSF10FunctionKey), - @(SRKeyCodeF11): SRUnicharToString(NSF11FunctionKey), - @(SRKeyCodeF12): SRUnicharToString(NSF12FunctionKey), - @(SRKeyCodeF13): SRUnicharToString(NSF13FunctionKey), - @(SRKeyCodeF14): SRUnicharToString(NSF14FunctionKey), - @(SRKeyCodeF15): SRUnicharToString(NSF15FunctionKey), - @(SRKeyCodeF16): SRUnicharToString(NSF16FunctionKey), - @(SRKeyCodeF17): SRUnicharToString(NSF17FunctionKey), - @(SRKeyCodeF18): SRUnicharToString(NSF18FunctionKey), - @(SRKeyCodeF19): SRUnicharToString(NSF19FunctionKey), - @(SRKeyCodeF20): SRUnicharToString(NSF20FunctionKey), - @(SRKeyCodeSpace): SRUnicharToString(' '), - @(SRKeyCodeDelete): SRUnicharToString(NSBackspaceCharacter), - @(SRKeyCodeForwardDelete): SRUnicharToString(NSDeleteCharacter), - @(SRKeyCodeKeypadClear): SRUnicharToString(NSClearLineFunctionKey), - @(SRKeyCodeLeftArrow): SRUnicharToString(NSLeftArrowFunctionKey), - @(SRKeyCodeRightArrow): SRUnicharToString(NSRightArrowFunctionKey), - @(SRKeyCodeUpArrow): SRUnicharToString(NSUpArrowFunctionKey), - @(SRKeyCodeDownArrow): SRUnicharToString(NSDownArrowFunctionKey), - @(SRKeyCodeEnd): SRUnicharToString(NSEndFunctionKey), - @(SRKeyCodeHome): SRUnicharToString(NSHomeFunctionKey), - @(SRKeyCodeEscape): SRUnicharToString('\e'), - @(SRKeyCodePageDown): SRUnicharToString(NSPageDownFunctionKey), - @(SRKeyCodePageUp): SRUnicharToString(NSPageUpFunctionKey), - @(SRKeyCodeReturn): SRUnicharToString(NSCarriageReturnCharacter), - @(SRKeyCodeKeypadEnter): SRUnicharToString(NSEnterCharacter), - @(SRKeyCodeTab): SRUnicharToString(NSTabCharacter), - @(SRKeyCodeHelp): SRUnicharToString(NSHelpFunctionKey) - }; - }); - return Mapping; -} - -+ (NSDictionary *)specialKeyCodeToLiteralMapping -{ - static NSDictionary *Mapping = nil; - static dispatch_once_t OnceToken; - dispatch_once(&OnceToken, ^{ - Mapping = @{ - @(SRKeyCodeF1): @"F1", - @(SRKeyCodeF2): @"F2", - @(SRKeyCodeF3): @"F3", - @(SRKeyCodeF4): @"F4", - @(SRKeyCodeF5): @"F5", - @(SRKeyCodeF6): @"F6", - @(SRKeyCodeF7): @"F7", - @(SRKeyCodeF8): @"F8", - @(SRKeyCodeF9): @"F9", - @(SRKeyCodeF10): @"F10", - @(SRKeyCodeF11): @"F11", - @(SRKeyCodeF12): @"F12", - @(SRKeyCodeF13): @"F13", - @(SRKeyCodeF14): @"F14", - @(SRKeyCodeF15): @"F15", - @(SRKeyCodeF16): @"F16", - @(SRKeyCodeF17): @"F17", - @(SRKeyCodeF18): @"F18", - @(SRKeyCodeF19): @"F19", - @(SRKeyCodeF20): @"F20", - @(SRKeyCodeSpace): SRLoc(@"Space"), - @(SRKeyCodeDelete): SRKeyCodeStringDeleteLeft, - @(SRKeyCodeForwardDelete): SRKeyCodeStringDeleteRight, - @(SRKeyCodeKeypadClear): SRKeyCodeStringPadClear, - @(SRKeyCodeLeftArrow): SRKeyCodeStringLeftArrow, - @(SRKeyCodeRightArrow): SRKeyCodeStringRightArrow, - @(SRKeyCodeUpArrow): SRKeyCodeStringUpArrow, - @(SRKeyCodeDownArrow): SRKeyCodeStringDownArrow, - @(SRKeyCodeEnd): SRKeyCodeStringSoutheastArrow, - @(SRKeyCodeHome): SRKeyCodeStringNorthwestArrow, - @(SRKeyCodeEscape): SRKeyCodeStringEscape, - @(SRKeyCodePageDown): SRKeyCodeStringPageDown, - @(SRKeyCodePageUp): SRKeyCodeStringPageUp, - @(SRKeyCodeReturn): SRKeyCodeStringReturnR2L, - @(SRKeyCodeKeypadEnter): SRKeyCodeStringReturn, - @(SRKeyCodeTab): SRKeyCodeStringTabRight, - @(SRKeyCodeHelp): @"?⃝" - }; - }); - return Mapping; -} - -- (instancetype)initWithASCIICapableKeyboardInputSource:(BOOL)aUsesASCII plainStrings:(BOOL)aUsesPlainStrings -{ - if (aUsesASCII && aUsesPlainStrings) - return SRASCIILiteralKeyCodeTransformer.sharedTransformer; - else if (aUsesASCII) - return SRASCIISymbolicKeyCodeTransformer.sharedTransformer; - else if (aUsesPlainStrings) - return SRLiteralKeyCodeTransformer.sharedTransformer; - else - return SRSymbolicKeyCodeTransformer.sharedTransformer; -} - -- (BOOL)usesASCIICapableKeyboardInputSource -{ - return [self isKindOfClass:SRASCIILiteralKeyCodeTransformer.class] || [self isKindOfClass:SRASCIISymbolicKeyCodeTransformer.class]; -} - -- (BOOL)usesPlainStrings -{ - return [self isKindOfClass:SRLiteralKeyCodeTransformer.class] || [self isKindOfClass:SRASCIILiteralKeyCodeTransformer.class]; -} - -- (NSString *)transformedValue:(NSNumber *)aValue withModifierFlags:(NSNumber *)aModifierFlags -{ - return [self transformedValue:aValue - withImplicitModifierFlags:aModifierFlags - explicitModifierFlags:nil - layoutDirection:NSUserInterfaceLayoutDirectionLeftToRight]; -} - -- (NSString *)transformedValue:(NSNumber *)aValue - withImplicitModifierFlags:(NSNumber *)anImplicitModifierFlags - explicitModifierFlags:(NSNumber *)anExplicitModifierFlags -{ - return [self transformedValue:aValue - withImplicitModifierFlags:anImplicitModifierFlags - explicitModifierFlags:anExplicitModifierFlags - layoutDirection:NSUserInterfaceLayoutDirectionLeftToRight]; -} - -- (NSString *)transformedSpecialKeyCode:(NSNumber *)aKeyCode - withExplicitModifierFlags:(NSNumber *)anExplicitModifierFlags -{ - return [self transformedValue:aKeyCode - withImplicitModifierFlags:nil - explicitModifierFlags:anExplicitModifierFlags - layoutDirection:NSUserInterfaceLayoutDirectionLeftToRight]; -} - -- (BOOL)isKeyCodeSpecial:(SRKeyCode)aKeyCode -{ - return self.class.specialKeyCodeToSymbolMapping[@(aKeyCode)] != nil; -} - -#pragma clang diagnostic pop - #pragma mark NSValueTransformer + (Class)transformedValueClass; diff --git a/Sources/ShortcutRecorder/SRModifierFlagsTransformer.m b/Sources/ShortcutRecorder/SRModifierFlagsTransformer.m index 93841a89..867a787f 100644 --- a/Sources/ShortcutRecorder/SRModifierFlagsTransformer.m +++ b/Sources/ShortcutRecorder/SRModifierFlagsTransformer.m @@ -25,29 +25,6 @@ + (id)sharedTransformer return SRSymbolicModifierFlagsTransformer.sharedTransformer; } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" - -+ (id)sharedPlainTransformer -{ - return SRLiteralModifierFlagsTransformer.sharedTransformer; -} - -- (id)initWithPlainStrings:(BOOL)aUsesPlainStrings -{ - if (aUsesPlainStrings) - return (id)SRLiteralModifierFlagsTransformer.sharedTransformer; - else - return (id)SRSymbolicModifierFlagsTransformer.sharedTransformer; -} - -- (BOOL)usesPlainStrings -{ - return [self isKindOfClass:SRSymbolicModifierFlagsTransformer.class]; -} - -#pragma clang diagnostic pop - + (Class)transformedValueClass { return NSString.class; diff --git a/Sources/ShortcutRecorder/SRRecorderControl.m b/Sources/ShortcutRecorder/SRRecorderControl.m index 87f350ed..48fbb543 100644 --- a/Sources/ShortcutRecorder/SRRecorderControl.m +++ b/Sources/ShortcutRecorder/SRRecorderControl.m @@ -389,7 +389,7 @@ - (void)_setStyle:(SRRecorderControlStyle *)newStyle } if (self.isRecording) - self.toolTip = _SRIfRespondsGet(self.style, recordingTooltip, SRLoc(@"Type shortcut")); + self.toolTip = _SRIfRespondsGet(self.style, recordingTooltip, SRLoc(@"Press keys now")); else self.toolTip = _SRIfRespondsGet(self.style, normalTooltip, SRLoc(@"Click to record shortcut")); } @@ -480,7 +480,7 @@ - (NSString *)drawingLabel label = self.stringValue; if (!label.length) - label = _SRIfRespondsGet(self.style, noValueRecordingLabel, SRLoc(@"Type shortcut")); + label = _SRIfRespondsGet(self.style, noValueRecordingLabel, SRLoc(@"Press keys now")); } else { @@ -568,7 +568,7 @@ - (BOOL)beginRecording [self updateActiveConstraints]; [self updateLabelConstraints]; [self updateTrackingAreas]; - self.toolTip = _SRIfRespondsGet(self.style, recordingTooltip, SRLoc(@"Type shortcut")); + self.toolTip = _SRIfRespondsGet(self.style, recordingTooltip, SRLoc(@"Press keys now")); if (self.pausesGlobalShortcutMonitorWhileRecording) { @@ -1098,7 +1098,7 @@ - (id)accessibilityValue else { if (!_objectValue) - return SRLoc(@"Empty"); + return SRLoc(@"Not set"); NSString *flags = [SRLiteralModifierFlagsTransformer.sharedTransformer transformedValue:@(_objectValue.modifierFlags) layoutDirection:NSUserInterfaceLayoutDirectionLeftToRight]; @@ -1135,7 +1135,7 @@ - (NSAccessibilityRole)accessibilityRole - (NSString *)accessibilityRoleDescription { if (self.isRecording) - return SRLoc(@"Type shortcut").localizedLowercaseString; + return SRLoc(@"Press keys now").localizedLowercaseString; else return SRLoc(@"Shortcut").localizedLowercaseString; } diff --git a/Sources/ShortcutRecorder/SRRecorderControlStyle.m b/Sources/ShortcutRecorder/SRRecorderControlStyle.m index ab6f037c..cfc47a01 100644 --- a/Sources/ShortcutRecorder/SRRecorderControlStyle.m +++ b/Sources/ShortcutRecorder/SRRecorderControlStyle.m @@ -502,7 +502,7 @@ - (BOOL)isEqual:(_SRRecorderControlStyleResourceLoaderCacheImageKey *)anObject return [self.identifier isEqual:anObject.identifier] && [self.components isEqual:anObject.components] && - [self.name isEqual:anObject]; + [self.name isEqual:anObject.name]; } - (id)copyWithZone:(NSZone *)aZone @@ -1249,7 +1249,7 @@ - (NSString *)noValueDisableLabel - (NSString *)noValueRecordingLabel { - return SRLoc(@"Type shortcut"); + return SRLoc(@"Press keys now"); } - (void)prepareForRecorderControl:(SRRecorderControl *)aControl diff --git a/Sources/ShortcutRecorder/SRShortcut.m b/Sources/ShortcutRecorder/SRShortcut.m index 07707bfe..c23e340f 100644 --- a/Sources/ShortcutRecorder/SRShortcut.m +++ b/Sources/ShortcutRecorder/SRShortcut.m @@ -19,11 +19,6 @@ SRShortcutKey const SRShortcutKeyCharacters = @"characters"; SRShortcutKey const SRShortcutKeyCharactersIgnoringModifiers = @"charactersIgnoringModifiers"; -NSString *const SRShortcutKeyCode = SRShortcutKeyKeyCode; -NSString *const SRShortcutModifierFlagsKey = SRShortcutKeyModifierFlags; -NSString *const SRShortcutCharacters = SRShortcutKeyCharacters; -NSString *const SRShortcutCharactersIgnoringModifiers = SRShortcutKeyCharactersIgnoringModifiers; - @implementation SRShortcut @@ -232,13 +227,25 @@ - (instancetype)initWithCode:(SRKeyCode)aKeyCode - (NSString *)readableStringRepresentation:(BOOL)isASCII { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SRKeyCodeTransformer *t = nil; if (isASCII) - return SRReadableASCIIStringForCocoaModifierFlagsAndKeyCode(self.modifierFlags, self.keyCode); + t = SRASCIILiteralKeyCodeTransformer.sharedTransformer; else - return SRReadableStringForCocoaModifierFlagsAndKeyCode(self.modifierFlags, self.keyCode); -#pragma clang diagnostic pop + t = SRLiteralKeyCodeTransformer.sharedTransformer; + + __auto_type keyCode = self.keyCode; + __auto_type modifierFlags = self.modifierFlags; + NSString *c = [t transformedValue:@(keyCode)]; + + if (!c) + c = [NSString stringWithFormat:@"<%hu>", keyCode]; + + return [NSString stringWithFormat:@"%@%@%@%@%@", + (modifierFlags & NSEventModifierFlagCommand ? SRLoc(@"Command-") : @""), + (modifierFlags & NSEventModifierFlagOption ? SRLoc(@"Option-") : @""), + (modifierFlags & NSEventModifierFlagControl ? SRLoc(@"Control-") : @""), + (modifierFlags & NSEventModifierFlagShift ? SRLoc(@"Shift-") : @""), + c]; } @@ -499,50 +506,3 @@ - (UInt32)carbonModifierFlags } @end - - -NSString *SRReadableStringForCocoaModifierFlagsAndKeyCode(NSEventModifierFlags aModifierFlags, SRKeyCode aKeyCode) -{ - SRKeyCodeTransformer *t = [SRKeyCodeTransformer sharedPlainTransformer]; - NSString *c = [t transformedValue:@(aKeyCode)]; - - if (!c) - c = [NSString stringWithFormat:@"<%hu>", aKeyCode]; - - return [NSString stringWithFormat:@"%@%@%@%@%@", - (aModifierFlags & NSEventModifierFlagCommand ? SRLoc(@"Command-") : @""), - (aModifierFlags & NSEventModifierFlagOption ? SRLoc(@"Option-") : @""), - (aModifierFlags & NSEventModifierFlagControl ? SRLoc(@"Control-") : @""), - (aModifierFlags & NSEventModifierFlagShift ? SRLoc(@"Shift-") : @""), - c]; -} - - -NSString *SRReadableASCIIStringForCocoaModifierFlagsAndKeyCode(NSEventModifierFlags aModifierFlags, SRKeyCode aKeyCode) -{ - SRKeyCodeTransformer *t = [SRKeyCodeTransformer sharedPlainASCIITransformer]; - NSString *c = [t transformedValue:@(aKeyCode)]; - - if (!c) - c = [NSString stringWithFormat:@"<%hu>", aKeyCode]; - - return [NSString stringWithFormat:@"%@%@%@%@%@", - (aModifierFlags & NSEventModifierFlagCommand ? SRLoc(@"Command-") : @""), - (aModifierFlags & NSEventModifierFlagOption ? SRLoc(@"Option-") : @""), - (aModifierFlags & NSEventModifierFlagControl ? SRLoc(@"Control-") : @""), - (aModifierFlags & NSEventModifierFlagShift ? SRLoc(@"Shift-") : @""), - c]; -} - - -BOOL SRKeyCodeWithFlagsEqualToKeyEquivalentWithFlags(SRKeyCode aKeyCode, - NSEventModifierFlags aKeyCodeFlags, - NSString *aKeyEquivalent, - NSEventModifierFlags aKeyEquivalentModifierFlags) -{ - SRShortcut *s = [[SRShortcut alloc] initWithCode:aKeyCode - modifierFlags:aKeyCodeFlags - characters:nil - charactersIgnoringModifiers:nil]; - return [s isEqualToKeyEquivalent:aKeyEquivalent withModifierFlags:aKeyEquivalentModifierFlags]; -} diff --git a/Sources/ShortcutRecorder/SRShortcutValidator.m b/Sources/ShortcutRecorder/SRShortcutValidator.m index c548bde9..a7785c0c 100644 --- a/Sources/ShortcutRecorder/SRShortcutValidator.m +++ b/Sources/ShortcutRecorder/SRShortcutValidator.m @@ -273,34 +273,6 @@ - (BOOL)recorderControl:(SRRecorderControl *)aRecorder canRecordShortcut:(SRShor return isValid; } - -#pragma mark Deprecated - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" - -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlagsTaken:(NSEventModifierFlags)aFlags error:(NSError * __autoreleasing *)outError; -{ - return ![self validateShortcut:[SRShortcut shortcutWithCode:aKeyCode modifierFlags:aFlags characters:nil charactersIgnoringModifiers:nil] error:outError]; -} - -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlagTakenInDelegate:(NSEventModifierFlags)aFlags error:(NSError * __autoreleasing *)outError -{ - return ![self validateShortcutAgainstDelegate:[SRShortcut shortcutWithCode:aKeyCode modifierFlags:aFlags characters:nil charactersIgnoringModifiers:nil] error:outError]; -} - -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlagsTakenInSystemShortcuts:(NSEventModifierFlags)aFlags error:(NSError * __autoreleasing *)outError -{ - return ![self validateShortcutAgainstSystemShortcuts:[SRShortcut shortcutWithCode:aKeyCode modifierFlags:aFlags characters:nil charactersIgnoringModifiers:nil] error:outError]; -} - -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlags:(NSEventModifierFlags)aFlags takenInMenu:(NSMenu *)aMenu error:(NSError * __autoreleasing *)outError -{ - return ![self validateShortcut:[SRShortcut shortcutWithCode:aKeyCode modifierFlags:aFlags characters:nil charactersIgnoringModifiers:nil] againstMenu:aMenu error:outError]; -} - -#pragma clang diagnostic pop - @end diff --git a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRKeyCodeTransformer.h b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRKeyCodeTransformer.h index 00fd5353..0848d3b3 100644 --- a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRKeyCodeTransformer.h +++ b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRKeyCodeTransformer.h @@ -36,11 +36,13 @@ NS_SWIFT_UNAVAILABLE("use SRLiteralKeyCodeTransformer / SRSymbolicKeyCodeTransfo @discussion The underlying type is TISInputSourceRef. - @note Shared transformers autoupdate their input sources to the current. + @note Shared transformers autoupdate their input sources to the current, thus returned value may not be persistent. */ @property (readonly) id inputSource; -- (instancetype)initWithInputSource:(id)anInputSource; +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithInputSource:(id)anInputSource NS_DESIGNATED_INITIALIZER; /*! Return literal string for the given key code, modifier flags and layout direction. @@ -115,25 +117,4 @@ NS_SWIFT_NAME(ASCIISymbolicKeyCodeTransformer) @interface SRASCIISymbolicKeyCodeTransformer : SRKeyCodeTransformer @end - -@interface SRKeyCodeTransformer (Deprecated) -@property (class, readonly) NSDictionary *specialKeyCodeToSymbolMapping; -@property (class, readonly) NSDictionary *specialKeyCodeToLiteralMapping; -@property (readonly) BOOL usesPlainStrings __attribute__((deprecated)); -@property (readonly) BOOL usesASCIICapableKeyboardInputSource __attribute__((deprecated)); -+ (instancetype)sharedASCIITransformer __attribute__((deprecated("", "SRASCIISymbolicKeyCodeTransformer/sharedTransformer"))); -+ (SRKeyCodeTransformer *)sharedPlainTransformer __attribute__((deprecated("", "SRLiteralKeyCodeTransformer/sharedTransformer"))); -+ (SRKeyCodeTransformer *)sharedPlainASCIITransformer __attribute__((deprecated("", "SRASCIILiteralKeyCodeTransformer/sharedTransformer"))); -- (instancetype)initWithASCIICapableKeyboardInputSource:(BOOL)aUsesASCII - plainStrings:(BOOL)aUsesPlainStrings __attribute__((deprecated)); -- (BOOL)isKeyCodeSpecial:(SRKeyCode)aKeyCode __attribute__((deprecated)); -- (NSString *)transformedValue:(NSNumber *)aValue - withModifierFlags:(NSNumber *)aModifierFlags __attribute__((deprecated)); -- (NSString *)transformedSpecialKeyCode:(NSNumber *)aKeyCode - withExplicitModifierFlags:(NSNumber *)aModifierFlags __attribute__((deprecated)); -- (NSString *)transformedValue:(NSNumber *)aValue - withImplicitModifierFlags:(NSNumber *)anImplicitModifierFlags - explicitModifierFlags:(NSNumber *)anExplicitModifierFlags __attribute__((deprecated)); -@end - NS_ASSUME_NONNULL_END diff --git a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRModifierFlagsTransformer.h b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRModifierFlagsTransformer.h index 922f6295..bf558558 100644 --- a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRModifierFlagsTransformer.h +++ b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRModifierFlagsTransformer.h @@ -32,13 +32,6 @@ NS_SWIFT_UNAVAILABLE("use SRLiteralModifierFlagsTransformer / SRSymbolicModifier @end -@interface SRModifierFlagsTransformer (Deprecated) -+ (SRLiteralModifierFlagsTransformer *)sharedPlainTransformer __attribute__((deprecated("", "SRLiteralModifierFlagsTransformer.shared"))); -- (instancetype)initWithPlainStrings:(BOOL)aUsesPlainStrings __attribute__((deprecated)); -@property (readonly) BOOL usesPlainStrings __attribute__((deprecated)); -@end - - /*! Transform modifier flags into a univesal symbolic string such as ⌘⌥. diff --git a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControl.h b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControl.h index 36d21012..1bd583d2 100644 --- a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControl.h +++ b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControl.h @@ -401,13 +401,6 @@ IB_DESIGNABLE @end -@interface SRRecorderControl (Deprecated) - -@property (readonly, getter=isCancelButtonHighlighted) BOOL isSnapBackButtonHighlighted __attribute__((deprecated("", "isCancelButtonHighlighted"))); - -@end - - NS_SWIFT_NAME(RecorderControlDelegate) @protocol SRRecorderControlDelegate diff --git a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControlStyle.h b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControlStyle.h index 3c0b91ec..07c5fd2d 100644 --- a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControlStyle.h +++ b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRRecorderControlStyle.h @@ -175,7 +175,7 @@ NS_SWIFT_NAME(RecorderControlStyle.Components) - (instancetype)initWithAppearance:(SRRecorderControlStyleComponentsAppearance)anAppearance accessibility:(SRRecorderControlStyleComponentsAccessibility)anAccessibility layoutDirection:(SRRecorderControlStyleComponentsLayoutDirection)aDirection - tint:(SRRecorderControlStyleComponentsTint)aTintNS_DESIGNATED_INITIALIZER; + tint:(SRRecorderControlStyleComponentsTint)aTint NS_DESIGNATED_INITIALIZER; - (BOOL)isEqualToComponents:(SRRecorderControlStyleComponents *)anObject; diff --git a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcut.h b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcut.h index 001e085f..f431726b 100644 --- a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcut.h +++ b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcut.h @@ -36,10 +36,6 @@ extern SRShortcutKey const SRShortcutKeyCharacters; */ extern SRShortcutKey const SRShortcutKeyCharactersIgnoringModifiers; -extern NSString *const SRShortcutKeyCode __attribute__((deprecated("Deprecated in 3.0", "SRShortcutKeyKeyCode"))); -extern NSString *const SRShortcutModifierFlagsKey __attribute__((deprecated("Deprecated in 3.0", "SRShortcutKeyModifierFlags"))); -extern NSString *const SRShortcutCharacters __attribute__((deprecated("Deprecated in 3.0", "SRShortcutKeyCharacters"))); -extern NSString *const SRShortcutCharactersIgnoringModifiers __attribute__((deprecated("", "SRShortcutKeyCharactersIgnoringModifiers"))); /*! Combination of a key code, modifier flags and optionally their characters @@ -235,57 +231,4 @@ NS_SWIFT_NAME(Shortcut) @end - -/*! - Check whether dictionary representations of shortcuts are equal (ShortcutRecorder 2). - */ -NS_INLINE BOOL SRShortcutEqualToShortcut(NSDictionary *a, NSDictionary *b) __attribute__((deprecated("Deprecated in 3.0", "SRShortcut/isEqual:"))); -NS_INLINE BOOL SRShortcutEqualToShortcut(NSDictionary *a, NSDictionary *b) -{ - if (a == b) - return YES; - else if (a && !b) - return NO; - else if (!a && b) - return NO; - else - return ([a[SRShortcutKeyKeyCode] isEqual:b[SRShortcutKeyKeyCode]] && [a[SRShortcutKeyModifierFlags] isEqual:b[SRShortcutKeyModifierFlags]]); -} - -/*! - Create ShortcutRecorder 2 shortcut. - */ -NS_INLINE NSDictionary *SRShortcutWithCocoaModifierFlagsAndKeyCode(NSEventModifierFlags aModifierFlags, SRKeyCode aKeyCode) __attribute__((deprecated("Deprecated in 3.0", "SRShortcut"))); -NS_INLINE NSDictionary *SRShortcutWithCocoaModifierFlagsAndKeyCode(NSEventModifierFlags aModifierFlags, SRKeyCode aKeyCode) -{ - return @{SRShortcutKeyKeyCode: @(aKeyCode), SRShortcutKeyModifierFlags: @(aModifierFlags)}; -} - - -/*! - Return string representation of a shortcut with modifier flags replaced with their - localized readable equivalents (e.g. ⌥ -> Option). - */ -NSString * _Nonnull SRReadableStringForCocoaModifierFlagsAndKeyCode(NSEventModifierFlags aModifierFlags, SRKeyCode aKeyCode) __attribute__((deprecated("Deprecated in 3.0", "SRShortcut/readableStringRepresentation:"))); - - -/*! - Return string representation of a shortcut with modifier flags replaced with their - localized readable equivalents (e.g. ⌥ -> Option) and ASCII character with a key code. - */ -NSString * _Nonnull SRReadableASCIIStringForCocoaModifierFlagsAndKeyCode(NSEventModifierFlags aModifierFlags, SRKeyCode aKeyCode) __attribute__((deprecated("Deprecated in 3.0", "SRShortcut/readableStringRepresentation:"))); - - -/*! - Check whether a given key code with modifier flags is equal to a key equivalent and key equivalent modifier flags - (e.g. from NSButton or NSMenuItem). - - @discussion - On macOS some key combinations can have "alternates". E.g. option-A can be represented both as "option-A" and "å". - */ -BOOL SRKeyCodeWithFlagsEqualToKeyEquivalentWithFlags(SRKeyCode aKeyCode, - NSEventModifierFlags aKeyCodeFlags, - NSString * _Nullable aKeyEquivalent, - NSEventModifierFlags aKeyEquivalentModifierFlags) __attribute__((deprecated("Deprecated in 3.0", "SRShortcut/isEqualToKeyEquivalent:withModifierFlags:"))); - NS_ASSUME_NONNULL_END diff --git a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcutValidator.h b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcutValidator.h index 78eb03db..6cab9ed6 100644 --- a/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcutValidator.h +++ b/Sources/ShortcutRecorder/include/ShortcutRecorder/SRShortcutValidator.h @@ -68,16 +68,6 @@ NS_SWIFT_NAME(ShortcutValidator) @end -@interface SRShortcutValidator(Deprecated) - -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlagsTaken:(NSEventModifierFlags)aFlags error:(NSError * _Nullable *)outError __attribute__((deprecated("", "validateShortcut:error:"))) NS_SWIFT_UNAVAILABLE("validateShortcut(_:)"); -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlagTakenInDelegate:(NSEventModifierFlags)aFlags error:(NSError * _Nullable *)outError __attribute__((deprecated("", "validateShortcutAgainstDelegate:error:"))) NS_SWIFT_UNAVAILABLE("validateShortcutAgainstDelegate(_:)"); -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlagsTakenInSystemShortcuts:(NSEventModifierFlags)aFlags error:(NSError * _Nullable *)outError __attribute__((deprecated("", "validateShortcutAgainstSystemShortcuts:error:"))) NS_SWIFT_UNAVAILABLE("Use validateShortcutAgainstSystemShortcuts(_:)"); -- (BOOL)isKeyCode:(SRKeyCode)aKeyCode andFlags:(NSEventModifierFlags)aFlags takenInMenu:(NSMenu *)aMenu error:(NSError * _Nullable *)outError __attribute__((deprecated("", "validateShortcut:againstMenu:error:"))) NS_SWIFT_UNAVAILABLE("Use validateShortcut(_:againstMenu:)"); - -@end - - @protocol SRShortcutValidatorDelegate @optional