Recent

Author Topic: OnMouseEnter event not trigged if left mouse button is pressed  (Read 643 times)

simsee

  • Full Member
  • ***
  • Posts: 194
I noticed that the TControl.OnMouseEnter event is not triggered if the left mouse button is pressed while the mouse cursor enters in the control surface.  Is this expected behavior? Thanks.
« Last Edit: July 13, 2024, 04:09:32 pm by simsee »

Thaddy

  • Hero Member
  • *****
  • Posts: 16201
  • Censorship about opinions does not belong here.
Re: OnMouseEnter event not trigged if left mouse button is pressed
« Reply #1 on: July 13, 2024, 04:17:08 pm »
Yes that is expected behavior, also when the right or mid button is pressed.
That is because the mouse operates in its current context. It keeps the state of that context. Only when NO buttons are pressed mouseenter/mouseleave picks up the new context.
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018