# Keyboard/Barcode Reader

This function block reads keyboard and barcode inputs and makes them available to the rest of your flow. It is useful for capturing typed text, barcode scanners that emulate keyboard input, or simple manual entries during runs.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

This function block does not have any inputs.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Text` The latest text line read from the keyboard or barcode device.

`Check` A boolean signal that indicates a new text value is available (useful as a trigger).

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Mode` Dropdown to choose the input behaviour. Typical options are "Key Press" and "Barcode Reading".

## 🎯 Features <a href="#features" id="features"></a>

* Background listening for keyboard-style input so the block provides the latest typed or scanned text without additional user interaction.
* Provides both the textual content (`Text`) and a trigger-like boolean (`Check`) to help you react only when new data arrives.
* Simple mode switch to treat incoming events as regular key presses or as barcode entries (useful for scanners that send a full code at once).

## 📝 Usage Instructions <a href="#usage" id="usage"></a>

1. Set the desired behaviour using `Mode`.
2. Connect this block's outputs to downstream blocks that process or store the text.
3. Use the `Check` output to trigger actions (for example, log or save the read text only when new data arrives).

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

When running, this block listens for keyboard/keyboard-emulating barcode events and updates its outputs with the latest read value and a new-data indicator.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* To persist scanned entries to disk, connect `Text` (or use `Check` as trigger) into `CSV Export` or `Data Write Local`.
* Use `Debug Input` to inspect values during development when you want quick logging of what is being read.
* If you want to combine image-based barcode reading with hardware scanners, use this block together with `Barcode Reader`: camera-based detection can serve as a fallback or cross-check.
* For manual testing or to inject values without hardware, pair with `String Input` to feed known values into your flow.
* To start workflows only when a code is read, feed `Check` into logical blocks such as `Logic Input` or use it to trigger `Image Logger` or `Image Write` for associating images with scanned IDs.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* No text appears: ensure your barcode scanner is configured as a keyboard wedge (many scanners send keystrokes).
* Scanner sends unexpected characters: check scanner suffix/prefix settings (e.g., carriage return or newline) in the device configuration.
* Duplicate or missed readings: try switching `Mode` between "Key Press" and "Barcode Reading" to match how your device sends data, and use the `Check` output to filter duplicates.
* Permissions or device access issues: verify the OS recognizes the keyboard/scanner and that no other application is exclusively capturing its input.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/function-blocks/input-output/data-inputs/keyboard-barcode-reader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
