# Perspective table onKeyPress event not firing

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-onkeypress-event-not-firing/92487>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [June 27, 2024, 6:27pm UTC](https://forum.inductiveautomation.com/t/perspective-table-onkeypress-event-not-firing/92487 "2024-06-27T18:27:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyler\_Dolan](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Tyler\_Dolan](https://forum.inductiveautomation.com/u/Tyler_Dolan)\
**Post date:** [June 27, 2024, 6:27pm UTC](https://forum.inductiveautomation.com/t/perspective-table-onkeypress-event-not-firing/92487/1 "2024-06-27T18:27:55Z")

</div>

I am trying to use keyboard events when clicked on the cell of a table.

I have a perspective table with an onKeyPress event script with just this line of code

```python
system.util.getLogger("testlogger").error("test")

```

Pressing keys doesn't cause this to print to the log. I tried moving this code to the click event which did print to the log, so it's not an issue with the code. I also tried clicking on a cell to give it focus and pressing a key, but that also didn't do anything.

Any ideas why this isn't working?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 27, 2024, 7:52pm UTC](https://forum.inductiveautomation.com/t/perspective-table-onkeypress-event-not-firing/92487/2 "2024-06-27T19:52:25Z")

</div>

Where are you looking for those logs at? The logger will print in the gateway logs not the designer's console.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7aa70e8ca3004ee432b241b8befddc812bea666e.png)

To print to the designer console with perspective use this

```python
system.perspective.print('Key Down: %s' % event.key)

```

---

<div class="post-metadata">

**Author:** ![Tyler\_Dolan](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@Tyler\_Dolan](https://forum.inductiveautomation.com/u/Tyler_Dolan)\
**Post date:** [June 27, 2024, 7:54pm UTC](https://forum.inductiveautomation.com/t/perspective-table-onkeypress-event-not-firing/92487/3 "2024-06-27T19:54:46Z")

</div>

I was looking at the gateway logs.

Did you do the same steps as me to get yours working?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 27, 2024, 7:56pm UTC](https://forum.inductiveautomation.com/t/perspective-table-onkeypress-event-not-firing/92487/4 "2024-06-27T19:56:06Z")

</div>

Yes, I went to my table and added a `keydown` event. Then looked in the console or gateway logs, depending if you are logging or printing. It works for me.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/64d3fda911cdd0d19f6b7d276282d977f29d34a7.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d71d990bc46fa753dde63dc8a3765df613795630.png)
