Forum Archive

Long press Action

mieq

Does Button View support long press action? If not, very much hope to add this feature. Thanks.

cvp

@mieq see @mikael gestures

mikael

@cvp, thought there might be some issue with the interaction of the built-in click and the added gesture, but no, works fine:

import ui
import gestures

def action(sender):
    sender.title = 'Clicked'

b = ui.Button(
    background_color='white',
    tint_color='black',
    action=action)

def longpressed(data):
    if data.began:
        data.view.title = 'Longpressed'

gestures.long_press(b, longpressed)

b.present('fullscreen')
cvp

@mikael I know that I have already used gestures with long press but not sure it was with a button, but I was confident 😀

mieq

@cvp Thank you!

cvp

@mieq don't thank me, but @mikael for his marvelous module 😀

mieq

@mikael Thank you! Your Modules are amazing!

mieq

@cvp Yes it's really amazing