From 0af13cf54c2ee953d0e71b5b4ed6b4a0afcaace8 Mon Sep 17 00:00:00 2001 From: Michel Storms Date: Sun, 6 Oct 2024 04:34:40 +0200 Subject: [PATCH] - renamed unregisterAll() to resetAll() --- .DS_Store | Bin 0 -> 6148 bytes Sources/.DS_Store | Bin 0 -> 6148 bytes .../KeyboardShortcuts/KeyboardShortcuts.swift | 9 +++++---- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .DS_Store create mode 100644 Sources/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..35476dcdb9df75f2d7a8003b552b02f8ac1f01a1 GIT binary patch literal 6148 zcmeHK%}T>S5Z-O8-BN@cR6GW}7EGZP!Apqs1&ruHr6wj|FlI}WkV7fts4wKB_&m<+ zZi}Tki|7o@ezWtl*?f@Q3}cLYWi({WVvGq;M2<#-pt~{DGRYhe6xMiRG0Vd$pM`0| zLch_4d+#!zNmjD?_x;NdA|K%_P4dEVK6$I%+1c%iuIP&g|5;Xk5fo+a1@k+cT}zpU zD?12plDL{$`xi1Rf+UOQsvwDCNV&gFvPf2*EVC$AwZ0CBp6E@j!^OfG*yHhVIj|RJ zrz5bP(Q?@n2gfJpSJRjDHIr|eNRE3)+0(Ed-`5ry!~iis3=jjvz%~Qs{t*4`5P66J zV&I=Mfaik^is%}wHL9Zn2Gs%pcEGI!Z0sel#y030tTjRegzHj3UCK?1!F4(KZIkC3 ztTpO##!d6V&68Kn3s+Bv^=*~TxT}#yVt^RfWT3657T*7t@X0hb`I{v)BL;|pKgIy> zO#F!lFJbQ+IRXHI22q;2m JAO?PbfiG3mMa2LB literal 0 HcmV?d00001 diff --git a/Sources/.DS_Store b/Sources/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ef31abfc68f2bb7cfc11e4de3e13349a5c57dbbb GIT binary patch literal 6148 zcmeHK%}T>S5T3QwrWB!qLXQEj1*Di`W_1{buK9lldUK82}J&9v%a<0l>mRC`hRgGFQ5`Ot3)2fqO{sVFn?1Fsaz+ zFPiAx_uvY~@CL!!`%A1OgJ;NbPJ<$y2C)n<`ZJiuQJVF7Ut+6P-`;6h4Xb56dJ|cA znV;pU>(B0Kbt7dQEOkG)jmE{Oy?-H-%#V`sOeI9&7(*WJq9l}sEAu2wRj#KUR?}*Z z+MW4)(C>Hc!JxnB+ViuM9_puq#iD5)93Gutk6z-}M80c!1yw|{t6?>NtTa}b0cL<1 zUgd2pwE&29G%G=!dI`$04LSx(jp#uU zIu%i;3e#c;osM?f#5o2_jXE8KX+DH`^0Ijm>gl+@t-?V#8hK_0n1OW$YI@nG`~MO@ znaU=AJ%v}y05kB<7!dWLH*~QmbGQB|kM3F<#}f_`iYrM$L4EBf02g$Qbd*#3ZPGE$ YF<5G(UC6G|5&1_z5yBHQ@Cyul1KrO^_W%F@ literal 0 HcmV?d00001 diff --git a/Sources/KeyboardShortcuts/KeyboardShortcuts.swift b/Sources/KeyboardShortcuts/KeyboardShortcuts.swift index 3f8aa4e1..de59fc4f 100644 --- a/Sources/KeyboardShortcuts/KeyboardShortcuts.swift +++ b/Sources/KeyboardShortcuts/KeyboardShortcuts.swift @@ -264,9 +264,9 @@ public enum KeyboardShortcuts { } /** - Unregister all keyboard shortcuts and remove their stored values from `UserDefaults`. + Reset all keyboard shortcuts and remove their stored values from `UserDefaults`. - This method unregisters all keyboard shortcuts registered via `KeyboardShortcuts` and removes any associated data stored in `UserDefaults`. + This method resets all keyboard shortcuts registered via `KeyboardShortcuts` and removes any associated data stored in `UserDefaults`. Use this method to completely reset the state of all keyboard shortcuts in your app, including removing any saved user-defined shortcuts and default shortcuts. @@ -274,11 +274,12 @@ public enum KeyboardShortcuts { - Important: This method affects all shortcuts registered with `KeyboardShortcuts` and should be used with caution. */ - public static func unregisterAll() { + public static func resetAll() { + // remove shortcuts CarbonKeyboardShortcuts.unregisterAll() registeredShortcuts.removeAll() - // remove user defaults too + // remove userdefaults let userDefaults = UserDefaults.standard for key in userDefaults.dictionaryRepresentation().keys where key.hasPrefix("KeyboardShortcuts_") {