rleiman Well-Known Member Licensed User Longtime User Jul 1, 2013 #1 Hi Everyone, I have 2 event handlers for a particular button. One handler is for the button down event and one for the button up event. Both event handlers execute even if the user taps the button and keeps a finger on the button without lifting up on the finger. I'm assuming this can be stopped by a setting but I don't know which one to set because I only want the button down to execute when the button is held down and the button up event to execute only when the user releases the button by lifting up on the finger. Thanks.
Hi Everyone, I have 2 event handlers for a particular button. One handler is for the button down event and one for the button up event. Both event handlers execute even if the user taps the button and keeps a finger on the button without lifting up on the finger. I'm assuming this can be stopped by a setting but I don't know which one to set because I only want the button down to execute when the button is held down and the button up event to execute only when the user releases the button by lifting up on the finger. Thanks.
Erel B4X founder Staff member Licensed User Longtime User Jul 2, 2013 #2 I recommend you to use a Panel instead and handle its Touch event. On some devices the Button Up / Down events keep firing even if the user doesn't move his finger. Upvote 0
I recommend you to use a Panel instead and handle its Touch event. On some devices the Button Up / Down events keep firing even if the user doesn't move his finger.
rleiman Well-Known Member Licensed User Longtime User Jul 2, 2013 #3 Hi Erel, Do you have a link to a sample project using the technique you are describing so I can learn how to do it? Thanks. Upvote 0
Hi Erel, Do you have a link to a sample project using the technique you are describing so I can learn how to do it? Thanks.
klaus Expert Licensed User Longtime User Jul 2, 2013 #4 Attached you find a small example with some special features. - The button image changes when the button is touched and released. - Displays tooltips. Best regards. Attachments ButtonDownUpWithPanel.zip ButtonDownUpWithPanel.zip 8.7 KB · Views: 992 Upvote 0
Attached you find a small example with some special features. - The button image changes when the button is touched and released. - Displays tooltips. Best regards.
Olaan Expert Licensed User Longtime User Jul 3, 2013 #5 klaus said: Attached you find a small example with some special features. - The button image changes when the button is touched and released. - Displays tooltips. Best regards. Click to expand... Nice example for me too. Upvote 0
klaus said: Attached you find a small example with some special features. - The button image changes when the button is touched and released. - Displays tooltips. Best regards. Click to expand... Nice example for me too.
A aleung Member Licensed User Longtime User Jan 21, 2014 #6 Erel said: I recommend you to use a Panel instead and handle its Touch event. On some devices the Button Up / Down events keep firing even if the user doesn't move his finger. Click to expand... If so , any draw back if I use small panels to replace using buttons (e.g. 20 buttons) on the same layout? Upvote 0
Erel said: I recommend you to use a Panel instead and handle its Touch event. On some devices the Button Up / Down events keep firing even if the user doesn't move his finger. Click to expand... If so , any draw back if I use small panels to replace using buttons (e.g. 20 buttons) on the same layout?
rleiman Well-Known Member Licensed User Longtime User Jan 21, 2014 #7 aleung said: If so , any draw back if I use small panels to replace using buttons (e.g. 20 buttons) on the same layout? Click to expand... Hi aleung, My app used to have 2 buttons. I replaced those with 2 panels the same size. I just used the images for each panel background where were the ones I used on each button. The sample klaus posted was really helpful in showing me how to handle the needed events. I use start a timer when the button is down and stop it when the button is up. Upvote 0
aleung said: If so , any draw back if I use small panels to replace using buttons (e.g. 20 buttons) on the same layout? Click to expand... Hi aleung, My app used to have 2 buttons. I replaced those with 2 panels the same size. I just used the images for each panel background where were the ones I used on each button. The sample klaus posted was really helpful in showing me how to handle the needed events. I use start a timer when the button is down and stop it when the button is up.