P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2018-12-26 16:09:14

njsokalski
Member
Registered: 2018-12-26
Posts: 5

MouseMoveRelative Not Working Correctly

I am using the XK-24, and have the following code:

    Case 1002 'Button 002
        If Layer_Red = 1 Then
            If State Then
                MW3.MouseMoveRelative(-1, 0)
                MW3.RepeatCID(MyDevice, CID, 3500, 1)
            Else
            End If
        Else
            If State Then
                MW3.MouseMoveRelative(1, 0)
                MW3.RepeatCID(MyDevice, CID, 3500, 1)
            Else
            End If
        End If
    Case 1003 'Button 003
        If Layer_Red = 1 Then
            If State Then
                MW3.MouseMoveRelative(0, -1)
                MW3.RepeatCID(MyDevice, CID, 3500, 1)
            Else
            End If
        Else
            If State Then
                MW3.MouseMoveRelative(0, 1)
                MW3.RepeatCID(MyDevice, CID, 3500, 1)
            Else
            End If
        End If

I expect this code to move the cursor horizontally or vertically. This is what the code used to do, but then (for no reason I am aware of) it stopped working correctly. After some experimenting, I obtained the following results:

Code: MW3.MouseMoveRelative(-1, -1)
Result: No movement (mouse cursor does not move)

Code: MW3.MouseMoveRelative(-1, 0)
Result: Mouse moves vertically down

Code: MW3.MouseMoveRelative(-1, 1)
Result: Mouse moves vertically down

Code: MW3.MouseMoveRelative(0, -1)
Result: Mouse moves horizontally to the right

Code: MW3.MouseMoveRelative(0, 0)
Result: Mouse moves down & to the right

Code: MW3.MouseMoveRelative(0, 1)
Result: Mouse moves down & to the right, but more quickly down than right

Code: MW3.MouseMoveRelative(1, -1)
Result: Mouse moves horizontally to the right

Code: MW3.MouseMoveRelative(1, 0)
Result: Mouse moves down & to the right, but more quickly right than down

Code: MW3.MouseMoveRelative(1, 1)
Result: Mouse moves down & to the right

These results seem very strange, and I am clueless as to what to try next. I have tried reinstalling MacroWorks (I have the latest version), but no help. I also ran EraseHWMacros.exe to make sure there were no HW macros interfering. What is the problem? What should I try next? Thanks.

Offline

#2 2019-01-03 14:15:28

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 182
Website

Re: MouseMoveRelative Not Working Correctly

njsokalski ,

Liam here I had been working with you on this issue, I had been unable to reproduce it but I gave it another shot today and I stumbled on something.

So, when we used the standard mouse move relative function it works as expected every time, EXCEPT if you have a dual monitor setup , I was testing/trying to break it today and mouse cursor happened to slide over to my second monitor and sure enough I saw the diagonal movement you've been reporting. The function works as expected and reliably so on my primary monitor but whenever I move the mouse to my secondary monitor I get the action.

I've sent in a bug report to our developers just now, I don't have an answer for you just yet but I'm sure they'll cook something up, I'm just reporting this to you now, maybe it's a clue that will lead you to a fix in your custom script? Regardless, I will let you know via email as soon as we have a patch/work-a-round.

Offline

#3 2019-01-03 14:59:18

njsokalski
Member
Registered: 2018-12-26
Posts: 5

Re: MouseMoveRelative Not Working Correctly

Thank you for that update. I do have a dual monitor setup, the monitors are
Surface Book i7 as my primary monitor
Dell E173FP
Acer X193W
I use these monitors connected through a Surface Dock. My XK-24 is also connected through the Surface Dock. However, the diagonal movement occurs even if I disconnect the Surface Dock & dual monitors and plug the XK-24 directly into the Surface Book i7's USB. If there are any other details about my setup that may be of use, let me know. Thank you again for the update.

Offline

#4 2019-01-03 15:39:20

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 182
Website

Re: MouseMoveRelative Not Working Correctly

I'll pass this along as well. Out of curiosity , if you disconnected all the other monitors from the Surface Dock and plugged the unit into the Surface Book's USB port do you still see the behavior?

Offline

#5 2019-01-03 15:59:42

njsokalski
Member
Registered: 2018-12-26
Posts: 5

Re: MouseMoveRelative Not Working Correctly

Yes. The behavior remains even if I remove everything except the Surface Book & XK-24 and plug it directly into the Surface Book's USB.

Offline

#6 2019-01-03 16:01:46

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 182
Website

Re: MouseMoveRelative Not Working Correctly

Thanks for checking that.

Offline

#7 2019-01-04 09:25:42

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 182
Website

Re: MouseMoveRelative Not Working Correctly

njsokalski ,

Yesterday afternoon, two of our engineers and myself thoroughly tested this issue and I'm afraid I don't have good news, this is Windows bug in how it handles some monitors / monitor setups.

Once I reported that I had finally been able to duplicate the issue , I heard back from our lead developer that she was still unable to reproduce it even with multiple monitors attached. She popped by my cubicle so that I could demonstrate it for her and we spent some time removing my monitors/monitor cables and bringing them over to the lab just to see if it was somehow related to the type of monitor and/or cables and adapters, no matter how we configured them we could not duplicate it with the WIN10 machines there.

We brought the whole lot back to my desk along with another engineer and sure enough, once I had everything connected again I was reliably able to reproduce the issue. The three of spent some more time with the display/advanced display settings and could not determine the issue.

Eventually , in the display settings we switched the potion of monitors from 2/1 to 1/2 and POOF the problem went away and everything started working as expected. I switched the monitor positions back and the bug immediately reappeared, disappearing again when I switch positions a third time. For some reason that we cannot determine, in my setup if my #2 monitor is positioned to the left  of me (in the Display settings) and #1 to the left the diagonal behavior appears.

This appears to be a bug in how the OS is communicating with the monitors , unfortunately there is little that we can do about it besides reporting this to Microsoft and hoping that this issue affects enough people in other ways that they squash it in an upcoming update.
I'm very sorry that I don't have an answer for you.

Of course we will continue to monitor this and I will keep looking online for any work around that other users may have found to address this bug in the OS.

Offline

#8 2019-01-04 10:54:19

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 182
Website

Re: MouseMoveRelative Not Working Correctly

UPDATE:

Found something interesting. We have both software mode and hardware mode mouse move relative functions. For some reason , the Hardware mode function does not exhibit the diagonal behavior. I'll report this and update my bug report. Could you test this out on your end as well?

Offline

#9 2019-01-04 11:45:28

njsokalski
Member
Registered: 2018-12-26
Posts: 5

Re: MouseMoveRelative Not Working Correctly

As I posted in an earlier post of this thread, my original code was the following:

            If Layer_Red = 1 Then
                If State Then
                    MW3.MouseMoveRelative(-1, 0)
                    MW3.RepeatCID(MyDevice, CID, 3500, 1)
                Else
                End If
            Else
                If State Then
                    MW3.MouseMoveRelative(1, 0)
                    MW3.RepeatCID(MyDevice, CID, 3500, 1)
                Else
                End If
            End If

I would be perfectly fine changing this to hardware mode (since it is a very simple macro that I have no plans of changing), however, I am not familiar with using hardware mode and don't want to mess up any of my other macros (which I do want to keep in software mode, since I do sometimes edit them). Can you give me a link to a site with information on using hardware mode (and still using software mode for the other buttons)? Thanks again.

Offline

#10 2019-01-17 17:18:05

njsokalski
Member
Registered: 2018-12-26
Posts: 5

Re: MouseMoveRelative Not Working Correctly

I want to mention something that I just noticed. If the button is pressed (the code is executed) while the cursor is on the primary monitor, the problem is what we have previously described. However, if the cursor is on another monitor when the button is pressed (or when the code is being re-executed by RepeatCID after moving the cursor to another monitor), the cursor is instantly moved to the corner of that monitor. I wanted to mention this to point out that the code is doing something different depending on which monitor the cursor is currently on.

Offline

Board footer

Powered by FluxBB