# Barcode Scanner Input - Variable Length

**URL:** <https://forum.inductiveautomation.com/t/barcode-scanner-input-variable-length/107080>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 5, 2025, 1:34pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-variable-length/107080 "2025-06-05T13:34:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [June 5, 2025, 2:13pm UTC](https://forum.inductiveautomation.com/t/barcode-scanner-input-variable-length/107080/3 "2025-06-05T14:13:30Z")

</div>

> [@Mark\_Flaugh](#):
>
> CHR(10).

I remember Perspective handles "Enter" a little differently from what one might expect, try `\n`:

> [@Perspective Key Event Regex New Line](https://forum.inductiveautomation.com/t/perspective-key-event-regex-new-line/51553/10):
>
> This is expected behavior, all. At the core of the regex match is the data that we receive from a [JavaScript KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) because this executes in the scope of the browser. We’re assembling a character sequence to match against from an input source (your barcode scanner) that creates KeyboardEvents. A “new line” character shows up as a key press for the “Enter” key. [https://keycode.info/](https://keycode.info/) is a pretty decent way to test what KeyboardEvent data your sequence would produce. It tests a key at a…

But honestly it would be better if you can change the scanner to output a different suffix as per Phil, to avoid keyboard getting picked up as a scan.

---

_[View the full topic](https://forum.inductiveautomation.com/t/barcode-scanner-input-variable-length/107080)._
