Do these events make sense to implement?

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

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

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

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.

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

but that wasn’t the question

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

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.

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.

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”

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

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

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…).

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

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.

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