Skip to content

Commit

Permalink
Make KeyEvent properties public
Browse files Browse the repository at this point in the history
  • Loading branch information
xtyxtyx committed Jan 5, 2025
1 parent c9a69f8 commit fa999ed
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Sources/Shaft/Core/Keyboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
// found in the LICENSE file.

public struct KeyEvent {

/// The type of the key event.
let type: KeyEventType
public let type: KeyEventType

/// Returns an object representing the physical location of this key.
///
Expand Down Expand Up @@ -48,7 +47,7 @@ public struct KeyEvent {
/// * [logicalKey] for the non-location specific key generated by this
/// event.
/// * [character] for the character generated by this keypress (if any).
let physicalKey: PhysicalKeyboardKey
public let physicalKey: PhysicalKeyboardKey

/// Returns an object representing the logical key that was pressed.
///
Expand All @@ -62,11 +61,17 @@ public struct KeyEvent {
/// [CupertinoTextField] widgets, since those automatically handle many of
/// the complexities of managing keyboard input, like showing a soft
/// keyboard or interacting with an input method editor (IME).
let logicalKey: LogicalKeyboardKey
public let logicalKey: LogicalKeyboardKey
}

/// Represents the type of a keyboard event.
public enum KeyEventType {
/// The key was pressed down.
case down

/// The key was released.
case up

/// The key is being held down and repeating.
case repeating
}

0 comments on commit fa999ed

Please sign in to comment.