# Power Table - un select row

**URL:** <https://forum.inductiveautomation.com/t/power-table-un-select-row/10035>\
**Category:** General Discussion\
**Created:** [May 19, 2015, 1:38pm UTC](https://forum.inductiveautomation.com/t/power-table-un-select-row/10035 "2015-05-19T13:38:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [May 19, 2015, 1:38pm UTC](https://forum.inductiveautomation.com/t/power-table-un-select-row/10035/1 "2015-05-19T13:38:03Z")

</div>

In a regular table, pressing escape will set the selected row to -1.

Can similar functionality be achieved on a power table?

---

<div class="post-metadata">

**Author:** ![glogue](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@glogue](https://forum.inductiveautomation.com/u/glogue)\
**Post date:** [May 19, 2015, 4:36pm UTC](https://forum.inductiveautomation.com/t/power-table-un-select-row/10035/2 "2015-05-19T16:36:53Z")

</div>

In the Event Types section of Ignition help, it looks like you can only use keyCode (like escape) on keyPressed and keyReleased events; these aren’t available on the Power Table but they are on the regular table.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 19, 2015, 4:58pm UTC](https://forum.inductiveautomation.com/t/power-table-un-select-row/10035/3 "2015-05-19T16:58:54Z")

</div>

You can add a custom keystroke handler to the PowerTable from within its initialize() extension method:

`def initialize(self):
	from javax.swing import AbstractAction, JComponent, KeyStroke
	class MyAction(AbstractAction):
		def actionPerformed(self, event):
			event.source.selectedRow = -1
	a = MyAction()
	k = KeyStroke.getKeyStroke("ESCAPE")
	self.registerKeyboardAction(a, k, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
`

---

<div class="post-metadata">

**Author:** ![Paolo.Mariani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paolo.mariani/32/3285_2.png) [@Paolo.Mariani](https://forum.inductiveautomation.com/u/Paolo.Mariani)\
**Post date:** [May 19, 2015, 8:32pm UTC](https://forum.inductiveautomation.com/t/power-table-un-select-row/10035/4 "2015-05-19T20:32:58Z")

</div>

I have made a feature request for our developers to look over, because we should be able to achieve similar functionality to the regular table.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [May 19, 2015, 9:13pm UTC](https://forum.inductiveautomation.com/t/power-table-un-select-row/10035/5 "2015-05-19T21:13:37Z")

</div>

Thanks Phil and Paolo!
