---
title: nextInputState()
framework: gamecontroller
role: symbol
role_heading: Instance Method
path: gamecontroller/gcdevicephysicalinput/nextinputstate()
---

# nextInputState()

Returns the next input state from the queue.

## Declaration

```swift
func nextInputState() -> (any GCDevicePhysicalInputState & GCDevicePhysicalInputStateDiff)?
```

## Mentioned in

Handling input events

## Return Value

Return Value The next input state in the queue or nil if the queue is empty.

## Discussion

Discussion This method removes the next input state from the queue.

## See Also

### Handling device input

- [inputStateAvailableHandler](gamecontroller/gcdevicephysicalinput/inputstateavailablehandler.md)
- [inputStateQueueDepth](gamecontroller/gcdevicephysicalinput/inputstatequeuedepth.md)
- [capture()](gamecontroller/gcdevicephysicalinput/capture().md)
- [elementValueDidChangeHandler](gamecontroller/gcdevicephysicalinput/elementvaluedidchangehandler.md)
