![]() |
#1
|
|||
|
|||
![]()
Hi people. This is the question:
Is there any posibility to get the position of the mouse as it appears in the low left corner in the status bar? Thanks in advance. Germán |
#2
|
||||
|
||||
![]()
Sure you can get the mouse Position of were a user clicks. This will keep looping until l you press "ESC". Also the messagebox lets you know if the shift, control or Alt key was depressed when clicked.
Code:
Sub MousePosition() Dim x As Double, y As Double Dim Shift As Long Dim b As Boolean Dim txtKey As String b = False txtKey = "No Key" While Not b b = ActiveDocument.GetUserClick(x, y, Shift, 10, False, cdrCursorEyeDrop) If Not b Then If (Shift And 1) <> 0 Then txtKey = "Shift" ' Shift depressed If (Shift And 2) <> 0 Then txtKey = "Ctrl" ' Ctrl depressed If (Shift And 4) <> 0 Then txtKey = "Alt" ' Alt depressed MsgBox "x: " & x & " y: " & y & Chr(13) & txtKey & " was depressed" End If Wend End Sub Shelby |
#3
|
|||
|
|||
![]()
Thanks shelby, but I was thinking if there's a way to get the mouse position as it moves, like you can see in the lower left corner. If anybody knows, i'll appreciate the answer.
|
#4
|
||||
|
||||
![]()
Well, technically it should be possible. But you will definitely have to use Windows API.
Here is some code that can show you how to translate the current mouse coordinates into the document coordinates: http://forum.oberonplace.com/showthread.php?t=1058 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Position inch to mm | GoodLook | CorelDRAW/Corel DESIGNER VBA | 2 | 11-11-2008 00:47 |
Position of shape.Text.Story.Characters(10) | met | CorelDRAW/Corel DESIGNER VBA | 3 | 08-12-2005 13:41 |
Relative position with group | RichT | CorelDRAW/Corel DESIGNER VBA | 12 | 19-10-2005 15:15 |
remember the position of a group | ivelink | CorelDRAW/Corel DESIGNER VBA | 7 | 18-10-2005 09:14 |
Getting the mouse position | Rick Randall | CorelDRAW/Corel DESIGNER VBA | 1 | 04-12-2002 09:29 |