# Key events in Perspective App

**URL:** <https://forum.inductiveautomation.com/t/key-events-in-perspective-app/61087>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 22, 2022, 11:20pm UTC](https://forum.inductiveautomation.com/t/key-events-in-perspective-app/61087 "2022-06-22T23:20:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [June 22, 2022, 11:20pm UTC](https://forum.inductiveautomation.com/t/key-events-in-perspective-app/61087/1 "2022-06-22T23:20:17Z")

</div>

I’m trying to use Key events in the perspective mobile application. using the following settings, I can’t seem to get it to work.

regex: `zach`  
script:

```auto
_l=system.util.getLogger('ztest')
_l.info('zach from keypress event.')

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1c19a080fe62157965bc62a02e7e34e7347e8e6.png)

It also doesn’t work from a browser on mobile, but it does work from a browser on a computer. I assume it must have something to do with the key press event (maybe a phone doesn’t actually create a key press event?).

Can I get this working?  
Device: Zebra TC21 (Android)  
Perspective App: v1.0.1-77  
Gateway: v8.1.17

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [June 23, 2022, 3:00pm UTC](https://forum.inductiveautomation.com/t/key-events-in-perspective-app/61087/2 "2022-06-23T15:00:52Z")

</div>

Doing some research of my own I found this note at [https://developer.android.com/training/keyboard-input/commands:](https://developer.android.com/training/keyboard-input/commands:)

**Note:** When handling keyboard events with the `KeyEvent` class and related APIs, you should expect that such keyboard events come only from a hardware keyboard. You should never rely on receiving key events for any key on a soft input method (an on-screen keyboard).

That doesn’t seem encouraging toward my goal…

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [June 23, 2022, 5:29pm UTC](https://forum.inductiveautomation.com/t/key-events-in-perspective-app/61087/3 "2022-06-23T17:29:12Z")

</div>

For anyone in the future, on the Zebra devices, you can change a setting to ask the barcode scanner to send scanned input at a key event. [Keystroke Output - Zebra Technologies TechDocs](https://techdocs.zebra.com/datawedge/latest/guide/output/keystroke/)

This doesn’t fix the soft keyboard issue, but it does let me scan QR codes with the built-in scanner and cause actions to happen, which was my original goal anyway.
