Skip to content

Commit

Permalink
⚰️ Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Mar 9, 2024
1 parent 00c7484 commit a14ce20
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions Loop/Extensions/CGKeyCode+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,36 +177,6 @@ extension CGKeyCode {
CGEventSource.keyState(.combinedSessionState, key: self)
}

// var keyCodeToString: Character? {
// let source = TISCopyCurrentKeyboardInputSource().takeRetainedValue()
// let layoutDataPointer = TISGetInputSourceProperty(source, kTISPropertyUnicodeKeyLayoutData)!.assumingMemoryBound(to: UCKeyboardLayout.self)
// let layoutData = unsafeBitCast(layoutDataPointer, to: CFData.self)
// let keyLayout = unsafeBitCast(CFDataGetBytePtr(layoutData), to: UnsafePointer<CoreServices.UCKeyboardLayout>.self)
//
// var deadKeyState: UInt32 = 0
// var chars: [UniChar] = [0, 0, 0, 0]
// var length = 0
//
// let result = UCKeyTranslate(
// keyLayout,
// UInt16(self),
// UInt16(kUCKeyActionDown),
// 0,
// UInt32(LMGetKbdType()),
// OptionBits(kUCKeyTranslateNoDeadKeysBit),
// &deadKeyState,
// 4,
// &length,
// &chars
// )
//
// if result == noErr {
// return String(utf16CodeUnits: chars, count: length).first
// } else {
// return nil
// }
// }

// From https://github.com/sindresorhus/KeyboardShortcuts/ but edited a bit
static let keyToString: [CGKeyCode: String] = [
.kVK_Return: "",
Expand Down

0 comments on commit a14ce20

Please sign in to comment.