Skip to content

Commit 03315a2

Browse files
committed
Update when polled
1 parent 7e9a34b commit 03315a2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/GateEngine/System/HID/GamePad/GamePadManager.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ extension HID {
3636
gamePad.interpreter.updateState(of: gamePad)
3737
}
3838
any = all.first(where: { $0.hasInput }) ?? nullGamePad
39+
if any.hasInput {
40+
hid.recentInputMethod = .gamePad
41+
}
3942
}
4043

4144
func update() {

Sources/GateEngine/System/HID/HID.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public enum InputMethod {
3838
public let gamePads: GamePadManger = GamePadManger()
3939

4040
/// The most recent input method used by the end user
41-
public private(set) var recentInputMethod: InputMethod = .mouseKeyboard
41+
public internal(set) var recentInputMethod: InputMethod = .mouseKeyboard
4242

4343
public var sharedReceipts: InputReceipts = InputReceipts()
4444

0 commit comments

Comments
 (0)