Skip to content

Commit dce8bdd

Browse files
committed
Update KeyCode
1 parent 49f832b commit dce8bdd

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

Sources/AndroidInput/Keycodes.swift

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
// MARK: - Key Code
1+
//
2+
// Keycodes.swift
3+
// SwiftAndroid
4+
//
5+
// Created by Alsey Coleman Miller on 2/27/26.
6+
//
7+
8+
#if os(Android)
9+
import Android
10+
import AndroidNDK
11+
#endif
212

313
/// Key code identifying a physical key on a keyboard or virtual key from an input device.
414
///
@@ -7,11 +17,15 @@
717
/// [See Also](https://developer.android.com/ndk/reference/group/input#anonymous-enum-3)
818
public struct KeyCode: RawRepresentable, Equatable, Hashable, Sendable {
919

10-
public let rawValue: Int32
20+
public let rawValue: Int
1121

12-
public init(rawValue: Int32) {
22+
public init(rawValue: Int) {
1323
self.rawValue = rawValue
1424
}
25+
26+
internal init(_ rawValue: Int32) {
27+
self.rawValue = Int(rawValue)
28+
}
1529
}
1630

1731
public extension KeyCode {

0 commit comments

Comments
 (0)