Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Mouse OutSide A Form

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-25-2009, 06:18 AM
Knows the basics
 
Join Date: Dec 2008
Posts: 77
Awards Showcase
Beta Tester 
Total Awards: 1
Default Mouse OutSide A Form

I thought there was a discussion about detecting it.

Can someone give me a link?
Reply With Quote
  #2 (permalink)  
Old 04-25-2009, 07:15 AM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

This happens only with MouseMove and MouseUp on the desktop.
If you want to avoid getting values from outsides you must check if x and y are insides the form limits.
Code:
If x >=0 and x<= Form.Width and y>= 0 and y<=Form.Height Then
Be aware that there is also a difference in the behaviour of the MouseMove event between the desktop and the device. On the desktop the MousMove event is fired even without a MouseDown event, on the device the MouseMove event is only fired after a MouseDown event (the contact of the stylus is needed). To avoid this you should add a flag in the MousDown event, test it in the MouseMove event and set it back in the MousUp event:
Code:
Sub Form_MouseDown(x,y)
  FlagMouse = 
1
End Sub
 
Sub Form_MouseMove(x,y)
  
If FlagMouse = 1 Then
  
End If
End Sub
 
Sub Form_MouseUp(x,y)
  FlagMouse = 
0
End Sub
Best regards.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #3 (permalink)  
Old 04-28-2009, 05:37 AM
Knows the basics
 
Join Date: Dec 2008
Posts: 77
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by klaus View Post
This happens only with MouseMove and MouseUp on the desktop.
If you want to avoid getting values from outsides you must check if x and y are insides the form limits.
Code:
If x >=0 and x<= Form.Width and y>= 0 and y<=Form.Height Then
Be aware that there is also a difference in the behaviour of the MouseMove event between the desktop and the device. On the desktop the MousMove event is fired even without a MouseDown event, on the device the MouseMove event is only fired after a MouseDown event (the contact of the stylus is needed). To avoid this you should add a flag in the MousDown event, test it in the MouseMove event and set it back in the MousUp event:
Code:
Sub Form_MouseDown(x,y)
  FlagMouse = 
1
End Sub
 
Sub Form_MouseMove(x,y)
  
If FlagMouse = 1 Then
  
End If
End Sub
 
Sub Form_MouseUp(x,y)
  FlagMouse = 
0
End Sub
Best regards.
Thanks for the response.

I was actually hoping it was possible on the device.

I was having issues with a PInvoke to GetIdleTime / GetTickTime.
It wasn't working the way I hoped.
And thought if I could detect when there were no clicks outside a form, it would achieve the same.

I have since worked out the correct calculation and works great.

Thanks Anyway
Reply With Quote
  #4 (permalink)  
Old 07-11-2009, 06:20 PM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I'm still tring to get this to work on the desktop, but i can only get the mousemove to trigger when it is on the form...
:-/

probably because i'm using sub form1_mousemove(x,y)..
Reply With Quote
  #5 (permalink)  
Old 07-11-2009, 06:29 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

eww245 see this post http://www.basic4ppc.com/forum/questions-help-needed/3711-prevent-screen-saver.html#post24541
you can get mouse position with it.
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #6 (permalink)  
Old 07-11-2009, 09:23 PM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default Byak@

Thanks Byak@,

Any chance you also know how to get the pixel color
at a specific position, also outside of the form?

I've been fiddling with the door lib... but it is not my day
Reply With Quote
  #7 (permalink)  
Old 07-12-2009, 07:45 AM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

emm...i'm not find it in msdn =(
but you can get screenshot with dzHW.dll and get mouse position.and now you can get pixel color.but this method not fast.
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #8 (permalink)  
Old 07-12-2009, 11:42 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

that was my next option... hopefully someone else reads this..
or i might make a new post

:-)
Reply With Quote
  #9 (permalink)  
Old 07-14-2009, 03:32 PM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

In case anyone is wondering, the above worked,
e.g. I'm taking a screenshot of 1x1 pixel and checking the RGB color
with Agraham's ImageEX lib...
Put this sub on a timer and presto... a color picker :-)
Reply With Quote
  #10 (permalink)  
Old 07-15-2009, 06:27 AM
Ariel_Z's Avatar
Basic4ppc Veteran
 
Join Date: May 2009
Posts: 246
Default

Thank you. It's a good and interesting solution.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Right Mouse button event? ExcludeReality Questions (Windows Mobile) 3 04-14-2009 10:06 AM
Hardware library V3.5 - Emulate mouse clicks Erel Official Updates 1 02-25-2009 10:17 AM
Diff GPS values without moving GPS mouse Georg Questions (Windows Mobile) 1 04-22-2008 06:58 AM
GPS Mouse dynamic platform setting lucifer1 Share Your Creations 0 06-03-2007 07:14 PM
Image Mouse events LineCutter Basic4ppc Wishlist 1 05-19-2007 10:24 AM


All times are GMT. The time now is 08:13 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0