Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: OnMouseEnter and OnMouseLeave event on (mobile) touch device issue



Permlink Replies: 2 - Last Post: Jun 4, 2015 4:57 AM Last Post By: Markus Humm
Isa Cayir

Posts: 1
Registered: 4/6/15
OnMouseEnter and OnMouseLeave event on (mobile) touch device issue
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 3, 2015 6:50 AM
Hi,

I'm working on a mobile application which has a long alphabetical list.
I have created a list of button from A to Z. so that when you press on one of them you go to the corresponding letter in the list.

This all works fine except for one thing.
Just like in a mobile phone its contacts list, I want to be able to swipe over list of letters and while doing so that the list automatically scrolls.

Now on firemonkey there is the OnMouseLeave event and OnMouseEnter event. When i compile it and test it on my computer with Win32 as target, the effect is exactly like I want while I go over it with my mouse, but that's not the case on a mobile device.

since I need to touch to screen before I'm able to "hover" (swipe) over the letter list, the click is registered on the letter you initially pressed and the OnMouseEnter event for that button triggers. But when I swipe over the letters without lifting up my finger, The OnMouseLeave of the initial button doesn't get triggered nor any other event on the other buttons.

How can I solve this? I tried disabling 'hit test' but then it doesn't trigger the OnMouseEnter and OnMouseLeave events at all.
Also tried disablign properties CanFocus, EnableDragHighlight to be sure, but didn't change anything.

So any help?

Edited by: Isa Cayir on Jun 4, 2015 12:31 AM
Kees Vermeulen

Posts: 23
Registered: 11/7/99
Re: OnMouseEnter and OnMouseLeave event on (mobile) touch device issue [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 4, 2015 1:28 AM   in response to: Isa Cayir in response to: Isa Cayir
Maybe it helps when you capture the mouse in the OnMouseEnter or
OnMouseDown event:

procedure TForm1.ControlMouseDown(Sender: TObject; Button:
TMouseButton; Shift: TShiftState; X, Y: Single);
begin
(Sender as TFmxObject).Root.Captured := <ControlToReceiveEvents>;
end;

On 4-6-2015 09:31, Isa Cayir wrote:

Hi,

I'm working on a mobile application which has a long alphabetical list.
I have created a list of button from A to Z. so that when you press on one of them you go to the corresponding letter in the list.

This all works fine except for one thing.
Just like in a mobile phone its contacts list, I want to be able to swipe over list of letters and while doing so that the list automatically scrolls.

Now on firemonkey there is the OnMouseLeave event and OnMouseEnter event. When i compile it and test it on my computer with Win32 as target, the effect is exactly like I want while I go over it with my mouse, but that's not the case on a mobile device.

since I need to touch to screen before I'm able to "hover" (swipe) over the letter list, the click is registered on the letter you initially pressed and the OnMouseEnter event for that button triggers. But when I swipe over the letters without lifting up my finger, The OnMouseLeave of the initial button doesn't get triggered nor any other event on the other buttons.

How can I solve this? I tried disabling 'hit test' but then it doesn't trigger the OnMouseEnter and OnMouseLeave events at all.
Also tried disablign properties CanFocus, EnableDragHighlight to be sure, but didn't change anything.

So any help?

Edited by: Isa Cayir on Jun 4, 2015 12:31 AM
Markus Humm

Posts: 5,113
Registered: 11/9/03
Re: OnMouseEnter and OnMouseLeave event on (mobile) touch device issue [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 4, 2015 4:57 AM   in response to: Isa Cayir in response to: Isa Cayir
Am 04.06.2015 um 09:31 schrieb Isa Cayir:
Hi,

I'm working on a mobile application which has a long alphabetical list.
I have created a list of button from A to Z. so that when you press on one of them you go to the corresponding letter in the list.

This all works fine except for one thing.
Just like in a mobile phone its contacts list, I want to be able to swipe over list of letters and while doing so that the list automatically scrolls.

Now on firemonkey there is the OnMouseLeave event and OnMouseEnter event. When i compile it and test it on my computer with Win32 as target, the effect is exactly like I want while I go over it with my mouse, but that's not the case on a mobile device.

since I need to touch to screen before I'm able to "hover" (swipe) over the letter list, the click is registered on the letter you initially pressed and the OnMouseEnter event for that button triggers. But when I swipe over the letters without lifting up my finger, The OnMouseLeave of the initial button doesn't get triggered nor any other event on the other buttons.

How can I solve this? I tried disabling 'hit test' but then it doesn't trigger the OnMouseEnter and OnMouseLeave events at all.
Also tried disablign properties CanFocus, EnableDragHighlight to be sure, but didn't change anything.

So any help?

Edited by: Isa Cayir on Jun 4, 2015 12:31 AM

Hello,

I don't have Delphi in front of me, but does the button also have
OnEnter and OnLeave methods? They'd be more generic about focus shift.
You could use them then?

Greetings

Markus
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02