KeyboardWedgeSource class
A ScanSource for keyboard wedge scanners (Zebra DataWedge keystroke output, Honeywell keyboard wedge, USB/Bluetooth HID scanners).
It listens to HardwareKeyboard while started and joins fast key bursts into codes with a WedgeAssembler. Keys that belong to a scan (all but the first character, and the terminator) are consumed, so the terminating Enter does not press a focused button.
While a text field has focus (ignoreWhenEditing, the default), the source stays out of the way: all keys go to the text field, typed text is never taken for a scan, and a scan made while typing lands in the field as a hardware scanner normally would.
- Implemented types
Constructors
- KeyboardWedgeSource({WedgeConfig config = const WedgeConfig(), bool ignoreWhenEditing = true, bool useEventTimestamps = true, ScanSymbology symbology = ScanSymbology.unknown, Duration clock()?, DateTime wallClock()?})
- Creates a source. Call start (or use KeyboardWedgeListener).
Properties
- config ↔ WedgeConfig
-
The assembler settings.
getter/setter pair
-
discarded
→ Stream<
WedgeStep> -
Bursts that were dropped (typed too slowly, too short, missing prefix...), for diagnostics.
no setter
-
frames
→ Stream<
ScanFrame> -
The frames of this source.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreWhenEditing ↔ bool
-
Ignore keys while an EditableText (e.g. a
TextField) has focus.getter/setter pair - isListening → bool
-
Whether the source is listening to the keyboard.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- symbology ↔ ScanSymbology
-
The symbology reported for codes (wedge scanners usually do not send it).
getter/setter pair
- useEventTimestamps ↔ bool
-
Prefer KeyEvent.timeStamp over
clockwhen it is non-zero.getter/setter pair
Methods
-
dispose(
) → void - Stops and closes the streams.
-
handleKeyEvent(
KeyEvent event) → bool - Handles one key event; returns whether it was consumed.
-
isConsumed(
KeyEvent event) → bool -
Whether
eventis the latest event seen by handleKeyEvent and was consumed. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → void - Starts listening to HardwareKeyboard.
-
stop(
) → void - Stops listening and drops a burst in progress.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited