Gadget longpress detection
Posted: Fri Sep 05, 2025 12:07 pm
Hey guys,
do you have any idea how a long press on a ListIconGadget entry can be detected?
Unfortunately, there are no events like #PB_EventType_DragStart or
#PB_EventType_LeftButtonDown, #PB_EventType_LeftButtonUp to determine the duration of the press.
I hoped it would be as easy as this one:
do you have any idea how a long press on a ListIconGadget entry can be detected?
Unfortunately, there are no events like #PB_EventType_DragStart or
#PB_EventType_LeftButtonDown, #PB_EventType_LeftButtonUp to determine the duration of the press.
I hoped it would be as easy as this one:
Code: Select all
Procedure onLongPress()
; do here the stuff after long press
EndProcedure
If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 290, 90, "Name", 100)
AddGadgetColumn(0, 1, "Address", 250)
AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 SpiderBasic Road, BigTown, CodeCity")
BindGadgetEvent(0, @onLongPress(), #PB_EventType_LeftLongClick)
EndIf