Recent

Author Topic: MacOS firing OnMouseWheelDn Twice  (Read 1873 times)

Josh

  • Hero Member
  • *****
  • Posts: 1271
MacOS firing OnMouseWheelDn Twice
« on: December 07, 2018, 03:38:44 pm »
Hi

I have various controls that support the mouse wheel, but on MacOS Carbon, the event is fired twice.
unfortunately I do not have a working cocoa to test if it also in there tooo.

Place a control that supports onmousewheeldown, set the event to showmessage('hi'); then run and move the scroll wheel, it fires twice.

Can anyone cofirm?

Laz 2.1.0, FPC 3.2  i386-darwin-carbon
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Josh

  • Hero Member
  • *****
  • Posts: 1271
Re: MacOS firing OnMouseWheelDn Twice
« Reply #1 on: December 08, 2018, 11:19:12 am »
I added the the following code to the wheelevents of the controls to ignore a rapid second fire

Code: [Select]

// notes  mac_stop_double_fire is a cardinal global varible
//            mac_stop_double_fire_limit  is a const i set at 12     

{$ifdef darwin}
  if datetimetotimestamp(now).time-mac_stop_double_fire<mac_stop_double_fire_limit then exit;
  mac_stop_double_fire:=datetimetotimestamp(now).time;
  {$endif}   
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018