Skip to content

Commit

Permalink
Removed the older code - after testing the replacement seems to work …
Browse files Browse the repository at this point in the history
…fine
  • Loading branch information
scornflake committed Jul 18, 2024
1 parent 3c1ac94 commit 0ffbb47
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions Sources/KeyboardShortcuts/SwiftUI+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<CFData>.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 {
Expand Down

0 comments on commit 0ffbb47

Please sign in to comment.