# Do these events make sense to implement?

**URL:** <https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605>\
**Category:** Other\
**Created:** [25 March 2021 16:00 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605 "2021-03-25T16:00:14Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [25 March 2021 16:00 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/1 "2021-03-25T16:00:14Z")

</div>

I am in the process of writing an alternative programming system for macOS.  
Part of which is creating drop in controls, such as buttons , textfields etc…

Looking at Xojo, I began thinking if it made sense to include these events as part of a “BUTTON” (for example)

- MouseEntered
- MouseExited
- MouseMoved
- MouseDragged
- keyDown
- keyUP

MouseDown/Up make sense but only to initiate the button action

---

<div class="post-metadata">

**Author:** ![anon76569242](https://ifnotnil.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@anon76569242](https://ifnotnil.com/u/anon76569242)\
**Post date:** [25 March 2021 17:47 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/2 "2021-03-25T17:47:09Z")

</div>

For a button, mouseentered and mouseexited can be used if you want to show graphically that the user is about to click that button, I believe I have seen this behavior in some applications, probably in older ones.

If the action event of the button can be triggered using the keyboard without the keydown and keyup events (if the action event can be triggered pressing a key while the button has focus), I see no use for keyDown/keyUp, otherwise they can be used to achieve that.

I can’t think of any use for the other events.

Julen

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [25 March 2021 19:22 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/3 "2021-03-25T19:22:32Z")

</div>

enter & exit I can see have use for a button - you might want to do some special highlighting or something like that

moved & dragged I’m less sure of

keyUP and down I cant recall implementing them on a button

---

<div class="post-metadata">

**Author:** ![Dale](https://ifnotnil.com/user_avatar/ifnotnil.com/dale/32/275_2.png) [@Dale](https://ifnotnil.com/u/Dale)\
**Post date:** [25 March 2021 19:48 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/4 "2021-03-25T19:48:59Z")

</div>

I can’t see any reason a button would to have a MouseDragged event. MouseEnter and MouseExit could be used to turn the mouse cursor to a form different than that of the rest of the app/window. The only thing I can think of where a MouseMoved event would be needed would be for a control that would probably be better done with a canvas.

---

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://ifnotnil.com/user_avatar/ifnotnil.com/monkeybreadsoftware/32/451_2.png) [@MonkeybreadSoftware](https://ifnotnil.com/u/MonkeybreadSoftware)\
**Post date:** [25 March 2021 21:15 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/5 "2021-03-25T21:15:01Z")

</div>

Those events are standard for controls and if you do them for a basic RectControl, they will be available for all controls.

---

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [25 March 2021 21:28 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/6 "2021-03-25T21:28:59Z")

</div>

but that wasn’t the question

---

<div class="post-metadata">

**Author:** ![ivan](https://ifnotnil.com/letter_avatar_proxy/v4/letter/i/df788c/32.png) [@ivan](https://ifnotnil.com/u/ivan)\
**Post date:** [25 March 2021 21:48 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/7 "2021-03-25T21:48:27Z")

</div>

> [@DaveS](#):
>
> I began thinking if it made sense to include these events as part of a “BUTTON”

That sounds a lot like the certain CEO I know. “If I dont use them, nobody does”. Asking users for imput is a bit less like him

> [@DaveS](#):
>
> but that wasn’t the question

But being narrow minded so to expect an aswer just the way you wanted instead of listening the user looks like even more like that CEO.

> [@MonkeybreadSoftware](#):
>
> Those events are standard for controls and if you do them for a basic RectControl, they will be available for all controls.

Maybe if we rewrite that as:

_YES it makes sense to include these events as part of a “BUTTON”_… because users expect those events to be part of a logic inheritance system for controls. Also is the user the one that can decide how to use them to make their apps as they wish and not being limited by the tool.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [25 March 2021 23:02 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/8 "2021-03-25T23:02:21Z")

</div>

> [@ivan](#):
>
> But being narrow minded so to expect an aswer just the way you wanted instead of listening the user looks like even more like that CEO.

There is no “RectControl” in Dave’s set up so its irrelevant and not addressing the question of “would these events even be useful on a button”

---

<div class="post-metadata">

**Author:** ![doj](https://ifnotnil.com/user_avatar/ifnotnil.com/doj/32/530_2.png) [@doj](https://ifnotnil.com/u/doj)\
**Post date:** [25 March 2021 23:08 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/9 "2021-03-25T23:08:33Z")

</div>

an off the wall though, and answering the OP, what about a TABBED event, if the rect control paradigm is not there?

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [25 March 2021 23:30 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/10 "2021-03-25T23:30:46Z")

</div>

I’m curious what you mean by Tabbed ? As in got focus and lost focus via tabbing ?

---

<div class="post-metadata">

**Author:** ![anic297](https://ifnotnil.com/user_avatar/ifnotnil.com/anic297/32/18_2.png) [@anic297](https://ifnotnil.com/u/anic297)\
**Post date:** [26 March 2021 11:03 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/11 "2021-03-26T11:03:46Z")

</div>

> [@npalardy](#):
>
> There is no “RectControl” in Dave’s set up so its irrelevant and not addressing the question of “would these events even be useful on a button”

So there’s no class inheritance at all in this language? Not a base control?  
This starts to be different than my vision of OOP languages (though I’m not an expert…).

---

<div class="post-metadata">

**Author:** ![DaveS](https://ifnotnil.com/user_avatar/ifnotnil.com/daves/32/79_2.png) [@DaveS](https://ifnotnil.com/u/DaveS)\
**Post date:** [26 March 2021 14:34 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/12 "2021-03-26T14:34:41Z")

</div>

To set things straight… yes there is a very nice class inheritance… and the equivalent of RectControl is NSResponder (there is a NSControl) but NSResponder is parent to more controls

And yes my framework leverages those common events. but still requires a few lines of unique code per control to delegate the event or other “special” actions… and the point of this question was how many of those controls was it worth that effort (which also includes having to write the control level documentation of those events etc

---

<div class="post-metadata">

**Author:** ![thorstenstueker](https://ifnotnil.com/letter_avatar_proxy/v4/letter/t/aca169/32.png) [@thorstenstueker](https://ifnotnil.com/u/thorstenstueker)\
**Post date:** [26 March 2021 17:07 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/13 "2021-03-26T17:07:47Z")

</div>

As I am looking from Java Swing I can say:  
I have  
Mouse clicked, excited, entered, pressed, released, moved, dragged MouseWheel Listener  
Keyboard pressed, released, typed  
and last but not… A Drop Listener for dropping on The Button

So I would like to say: should be implemented for this kind of controls cause can be needed. As far it is possible: with mouse position on Click at least.

---

<div class="post-metadata">

**Author:** ![doj](https://ifnotnil.com/user_avatar/ifnotnil.com/doj/32/530_2.png) [@doj](https://ifnotnil.com/u/doj)\
**Post date:** [26 March 2021 19:05 UTC](https://ifnotnil.com/t/do-these-events-make-sense-to-implement/1605/14 "2021-03-26T19:05:19Z")

</div>

yes, when someone used the tab key to select the control
