# G4P - Specifying Listener Method

**URL:** <https://discourse.processing.org/t/g4p-specifying-listener-method/18258>\
**Category:** Libraries\
**Created:** [February 29, 2020, 10:04pm UTC](https://discourse.processing.org/t/g4p-specifying-listener-method/18258 "2020-02-29T22:04:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [March 1, 2020, 10:05am UTC](https://discourse.processing.org/t/g4p-specifying-listener-method/18258/2 "2020-03-01T10:05:30Z")

</div>

The question posed in the first paragraph seems to be basically the same as the question in your [second post](https://discourse.processing.org/t/g4p-defining-handlebuttonevents-in-a-class/18262) which I have answered so I suggest you look there for an answer.

> [@MauiMana](#):
>
> Also, in G4P can one setup a listener not just on a specific control but also for a specific type of event?

No but you can test the event type inside the event handler e.g.  
`if(event == GEvent.CLICKED) { // do something`

---

_[View the full topic](https://discourse.processing.org/t/g4p-specifying-listener-method/18258)._
