Skip to content

Commit

Permalink
Update expression
Browse files Browse the repository at this point in the history
  • Loading branch information
ctreffs committed Oct 12, 2021
1 parent 1c7e179 commit daf0d3f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/SDLKit/SDLKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,19 @@ extension SDL_Event {
}

extension SDL_KeyCode {

public static func ~= (lhs: Int, rhs: SDL_KeyCode) -> Bool {
return lhs == rhs
}

public static func ~= (lhs: SDL_KeyCode, rhs: Int) -> Bool {
return lhs == rhs
}

public static func ==(lhs: Int, rhs: SDL_KeyCode) -> Bool {
return SDL_KeyCode(UInt32(lhs)) == rhs
}

public static func ==(lhs: SDL_KeyCode, rhs: Int) -> Bool {
return lhs == SDL_KeyCode(UInt32(rhs))
}
Expand Down

0 comments on commit daf0d3f

Please sign in to comment.