# Use Mouse-funktions in classes

**URL:** https://discourse.processing.org/t/use-mouse-funktions-in-classes/29673
**Category:** Coding Questions
**Created:** [April 27, 2021, 5:09am UTC](https://discourse.processing.org/t/use-mouse-funktions-in-classes/29673 "2021-04-27T05:09:55Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [April 27, 2021, 10:38am UTC](https://discourse.processing.org/t/use-mouse-funktions-in-classes/29673/5 "2021-04-27T10:38:03Z")

</div>

> [@TimeLex](#):
>
> … but the function is not triggered in a class:

> [@Handle (and consume) mouse events in classes](https://discourse.processing.org/t/handle-and-consume-mouse-events-in-classes/17689/4):
>
> To my surprise, Processing doesn’t directly call back input events such as mousePressed(), keyReleased(), etc. open_mouth But only these 2 input events: mouseEvent() & keyEvent(). drooling_face So we can only use those 2 for registerMethod() as input events: /\*\* \* RegisterMethod MouseEvent (v1.0) \* GoToLoop (2020/Feb/10) \* \* https://Discourse.Processing.org/t/ \* handle-and-consume-mouse-events-in-classes/17689/4 \* \* https://GitHub.com/processing/processing/wiki/ \* Library-Basics#w…

---

_[View the full topic](https://discourse.processing.org/t/use-mouse-funktions-in-classes/29673)._
