From 0ffbb472db47e473e2191187fe8b574ca8adac99 Mon Sep 17 00:00:00 2001 From: Neil Clayton Date: Thu, 18 Jul 2024 14:37:01 +1200 Subject: [PATCH] Removed the older code - after testing the replacement seems to work fine --- .../SwiftUI+Extensions.swift | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/Sources/KeyboardShortcuts/SwiftUI+Extensions.swift b/Sources/KeyboardShortcuts/SwiftUI+Extensions.swift index 42c69dbc..38d031e9 100644 --- a/Sources/KeyboardShortcuts/SwiftUI+Extensions.swift +++ b/Sources/KeyboardShortcuts/SwiftUI+Extensions.swift @@ -74,33 +74,6 @@ extension KeyboardShortcuts.Shortcut { return nil } return KeyEquivalent(Character(keyCharacter)) - -// let carbonKeyCode = UInt16(self.carbonKeyCode) -// let maxNameLength = 4 -// var nameBuffer = [UniChar](repeating: 0, count: maxNameLength) -// var nameLength = 0 -// -// let modifierKeys = UInt32(alphaLock >> 8) & 0xFF // Caps Lock -// var deadKeys: UInt32 = 0 -// let keyboardType = UInt32(LMGetKbdType()) -// -// let source = TISCopyCurrentKeyboardLayoutInputSource().takeRetainedValue() -// guard let ptr = TISGetInputSourceProperty(source, kTISPropertyUnicodeKeyLayoutData) else { -// NSLog("Could not get keyboard layout data") -// return nil -// } -// let layoutData = Unmanaged.fromOpaque(ptr).takeUnretainedValue() as Data -// let osStatus = layoutData.withUnsafeBytes { -// UCKeyTranslate($0.bindMemory(to: UCKeyboardLayout.self).baseAddress, carbonKeyCode, UInt16(kUCKeyActionDown), -// modifierKeys, keyboardType, UInt32(kUCKeyTranslateNoDeadKeysMask), -// &deadKeys, maxNameLength, &nameLength, &nameBuffer) -// } -// guard osStatus == noErr else { -// NSLog("Code: 0x%04X Status: %+i", carbonKeyCode, osStatus); -// return nil -// } -// -// return KeyEquivalent(Character(String(utf16CodeUnits: nameBuffer, count: nameLength))) } var toEventModifiers: SwiftUI.EventModifiers {