# Perspective Key Event Regex New Line

**URL:** <https://forum.inductiveautomation.com/t/perspective-key-event-regex-new-line/51553>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 2, 2021, 6:01am UTC](https://forum.inductiveautomation.com/t/perspective-key-event-regex-new-line/51553 "2021-10-02T06:01:37Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [October 8, 2021, 4:49pm UTC](https://forum.inductiveautomation.com/t/perspective-key-event-regex-new-line/51553/10 "2021-10-08T16:49:58Z")

</div>

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 time, but knowing what your sequence looks like, you could type it out on your keyboard to generate the KeyboardEvent and observe the `event.key` value in the tool.

[Check out the docs site for more info](https://docs.inductiveautomation.com/display/DOC81/Perspective+Session+Event+Scripts#PerspectiveSessionEventScripts-KeyEvents).

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-key-event-regex-new-line/51553)._
