Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed May 1, 2022
1 parent 79c5590 commit a0afaa6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions Sources/SwiftKeys/Key.swift
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ extension KeyEvent {
/// The Kana key that is available on JIS keyboards.
case jisKana

// MARK: - Raw Value
// MARK: - Properties

/// The raw value of the key.
public var rawValue: Int {
Expand Down Expand Up @@ -361,8 +361,6 @@ extension KeyEvent {
}
}

// MARK: - String Value

/// A string representation of the key.
public var stringValue: String {
switch self {
Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftKeys/KeyEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public struct KeyEvent {
static var keyEventStorage = [Name: KeyEvent]()
static var proxyStorage = [Name: EventProxy]()

/// The name that is be used to store this key event.
public let name: Name

/// The key associated with this key event.
public var key: Key? {
proxy.key
Expand All @@ -95,9 +98,6 @@ public struct KeyEvent {
proxy.modifiers
}

/// The name that is be used to store this key event.
public let name: Name

var proxy: EventProxy {
if let proxy = Self.proxyStorage[name] {
return proxy
Expand All @@ -108,7 +108,7 @@ public struct KeyEvent {
}
}

// Implementation detail:
// Implementation.
private init?(_name: Name) {
if
let data = UserDefaults.standard.data(forKey: _name.combinedValue),
Expand Down

0 comments on commit a0afaa6

Please sign in to comment.