Page 1 of 1
Event LeftClick: only when release + only occasionally
Posted: Sat Mar 01, 2014 3:08 pm
by Lebostein
The #PB_EventType_LeftClick on Mac OS drives me crazy!
1. I get this event only if I release the mouse button (on Windows: if mouse button is pressed)
2. This event occurs only, if I click very short! If I hold some milliseconds, NO event occurs
Is this a bug?
Re: Event LeftClick: only when release + only occasionally
Posted: Sun Mar 02, 2014 5:34 am
by WilliamL
I see what you mean. The right-click and the left-click behave differently (in this example). The right-click gives an event immediately but the left-click doesn't respond until the button is released. I do not have any problem with the left-click giving an event whether I hold it for a short or long period.
Code: Select all
If OpenWindow(0, 0, 0, 230, 120, "Eventtypes example...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(1, 10, 10, 150, 100, "ListIcon", 140, #PB_ListIcon_GridLines)
For a = 1 To 4
AddGadgetItem(1, -1, "Line "+Str(a))
Next
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 1
Select EventType()
Case #PB_EventType_LeftClick : Debug "Click with left mouse button"
Case #PB_EventType_RightClick : Debug "Click with right mouse button"
Case #PB_EventType_LeftDoubleClick : Debug "Double-click with left mouse button"
Case #PB_EventType_RightDoubleClick : Debug "Double-click with right mouse button"
EndSelect
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
Re: Event LeftClick: only when release + only occasionally
Posted: Sun Mar 02, 2014 2:52 pm
by Lebostein
It seems a problem with the ImageGadget! If you click short, the you get an event, if the mouse button is released. If you hold some milliseconds, no event occurs.
Code: Select all
CreateImage(0, 230, 120)
If OpenWindow(0, 0, 0, 230, 120, "Eventtypes example...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ImageGadget(1, 0, 0, 0, 0, ImageID(0))
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 1
Select EventType()
Case #PB_EventType_LeftClick : Debug "Click with left mouse button"
Case #PB_EventType_RightClick : Debug "Click with right mouse button"
Case #PB_EventType_LeftDoubleClick : Debug "Double-click with left mouse button"
Case #PB_EventType_RightDoubleClick : Debug "Double-click with right mouse button"
EndSelect
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
Re: Event LeftClick: only when release + only occasionally
Posted: Sun Mar 02, 2014 6:16 pm
by WilliamL
Yikes, with your example I get all sorts of problems! The right-click will repeat after holding it down a while or it doesn't respond at all. Sometime the left-click doesn't respond. It's all very random. I was going to say that it works ok if you just click with a normal short deliberate click but that doesn't always work either. I'm wondering if it affects all the clicking events and so all gadgets or if it is confined to the Image gadget even though the clicking behavior is not the same with the ListIcon gadget (as shown above).
I can just imagine Fred getting a headache...