Recent

Author Topic: OnEnter not firing on button press  (Read 3245 times)

ranlaborde

  • New Member
  • *
  • Posts: 11
OnEnter not firing on button press
« on: August 11, 2017, 12:23:21 pm »
I am having difficulty with the OnEnter event not executing when a button is clicked.  It fires when run on Windows but but not on Mac.  I am using the OnEnter to validate entered data prior to proceeding to the next step in my application.  I have Sierra 10.12.6.  I am using Lazarus 1.6.4.  Why is the behavior different?  Is there a fix or a work around?  I am attaching a sample file. Thanks 

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: OnEnter not firing on button press
« Reply #1 on: August 13, 2017, 07:13:06 am »
Nice example of the problem. I suggest filing two bug reports on [https://mantis.freepascal.org/my_view_page.php]. File one bug report for the Carbon LCL and one for the Cocoa LCL, as the problem exists with both.

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: OnEnter not firing on button press
« Reply #2 on: August 13, 2017, 08:27:22 am »
I wonder if it is supported...with the mouse driver in OSX. What happens when you select a button with the tab key and press enter?
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: OnEnter not firing on button press
« Reply #3 on: August 13, 2017, 09:41:56 am »
I'm testing this on Lazarus 1.8.0RC3 on the Apple Mac with the Carbon widget set.

As soon as the app starts, if I press the tab key just the once, I see the list box receive focus, and I see messages saying First Button Enter AND Second Button Enter.

I don't know what this means, having just this minute woken up, but someone more skilled than I will hopefully understand what on earth is going on!
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

ranlaborde

  • New Member
  • *
  • Posts: 11
Re: OnEnter not firing on button press
« Reply #4 on: August 13, 2017, 12:01:54 pm »
What is going on is that the Listbox displays the order of events that occur under different situations, such as tabbing or clicking.  What occurs is that on the Mac the events OnEnter and OnExit are bypassed.  This, I have figured out, is because the focus does not change (unlike in Windows) when controls such as buttons are clicked. 

 

TinyPortal © 2005-2018