EitherMouse 0.8 - Multiple mice, individual settings...

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

12 Aug 2020, 14:12

Thats the real problem with aggressive false positives, people are now clicking through and accepting on things without even thinking about it because you have to do the same thing for clearly legitimate programs! grr
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
9swampy
Posts: 1
Joined: 09 Sep 2020, 18:08

Re: EitherMouse 0.8 - Multiple mice, individual settings...

09 Sep 2020, 18:50

Brilliant! Kudos @gwarble.

As a leftie that's developed RSI I got myself a leftie ergonomic mouse and discovered something I never even considered in 40 years of pretty much using a compuer mouse every day; I left click with the left button and right click with the right - never even occurred to me righties left click with their index and right click with their middle. Some genius decided to flip the left and right buttons on a leftie mouse to compensate leaving it completely unusable for me. One came with a driver that allowed me to flip the buttons - but it's no more than a shortcut for the global windows setting so all mice got affected. EitherMouse worked! Suitable caution given to the false positive virus warning...

However, I access dozens upon dozens of sessions via RDP and I'm finding it's not quite behaving right with RDP. Seems like this gets confused with which mouse is being passed through; sometimes it works, sometimes not. Anyone got any tips to apply? Do I have to run in every instance? Is there a way to pre-recognise my leftie mouse as mouse 1 every time and my rightie as mouse 2 and have the settings keep in sync?
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

09 Sep 2020, 19:32

Thanks for the feedback... There is some misbehaving with RDP and VNC connections because of the way the window is accepting input and passing it along to the remote session. The best workaround I've found has been to actually revert back to the method I used in v0.1 of swapping mouse buttons, via hotkey... Unfortunately I haven't re-explored implementing that method back into EitherMouse in quite some time.

Start by exploring X-Mouse Button Control and see if it solves your problem, in combination with EitherMouse... at one point I was in discussion with the author to work on a communication method between our two tools but it didn't really go anywhere unfortunately.

I will bump up a solution on my to do list but I rarely have time to work on this much (and am totally turned off by the false positive virus flagging going on, its bullshit for the small "developer")
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

10 Dec 2020, 01:31

New user. I have a ThinkPad. I'm adding an external ThinkPad keyboard. I found EitherMouse and downloaded it. When I first ran it, it asked me to use my primary mouse. I did and it seems now to be known.

But I can find no way to ask it to discover the TrackPoint on the external keyboard. It's probably a stupid question, but how do I do that?
RSMilward
Posts: 6
Joined: 25 Apr 2020, 14:36

Re: EitherMouse 0.8 - Multiple mice, individual settings...

10 Dec 2020, 07:15

It should detect the TrackPoint as soon as you move it, and the Settings box will change from Mouse1 to Mouse2. (That's what it does with my 2 trackballs.)
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

10 Dec 2020, 12:28

RSMilward wrote:
10 Dec 2020, 07:15
It should detect the TrackPoint as soon as you move it, and the Settings box will change from Mouse1 to Mouse2. (That's what it does with my 2 trackballs.)
Thanks for the quick response. Now I know how it is supposed to work, I see that it does just as you say. Never crossed my mind that, in Settings, you select which mouse you are setting by USING it. If you are changing a setting which is making the mouse unusable, that would be problematic. But that wasn't a problem in my case and I can't think of an example. Maybe with the mouse that can't happen.

Thanks
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

10 Dec 2020, 12:36

My second day using EitherMouse:

• I had renamed Mouse 1. After defining my secondary mouse by using it, I renamed it as well. When I then used the primary mouse, Settings shows Mouse 3. Surprise! What is that all about?

• My whole point of using EitherMouse was to be able to speed up both, independently. But they both show the maximum speed of 20 in Settings, while, in fact, they are both too slow and different than each other.

Any ideas?
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

10 Dec 2020, 19:55

Thanks for asking and helping eachother...

Yes this design is flawed if you wanted to configure a mouse that isn’t fully usable, but you can always work around it by using the keyboard or editing the registry directly, some day i’ll fix it

Due to drivers, sometimes some mice input or feature of a mouse might register with a device id/handle of “0”, which could become a third nonexistant mouse. There is a settings>advanced>
"ignore zero device" option to toggle, it might work better for you the other way

For the max speed, EitherMouse sets the Windows speed the same as the mouse control panel, so 20 is the built in max and actually how fast that is is controlled by the hardware’s design/rate/drivers... There is a plugin feature of EitherMouse and an example called "DoubleSpeed.ahk", somewhere deep in this thread or the old thread, or i can dig it out if you’re interested, might help you overcome a “too slow even at 20” mouse


Edit: Still appears to work in Windows 10 but I had to run it as adminstrator, here is DoubleSpeed.ahk which will double the speed of Mouse 1. Run this along with EitherMouse, if you want all mice affected it should be pretty obvious what to edit if you know AHK, if not just ask, its easy:

Code: Select all

#NoEnv
#SingleInstance, Force
#Persistent
SetWorkingDir %A_ScriptDir%
OnExit, OnExit
 OnMessage(WM_EitherMouse:=DllCall("RegisterWindowMessage",Str,"EitherMouse"),"WM_EitherMouse")
 DetectHiddenWindows, On
 SendMessage,WM_EitherMouse,WM_EitherMouse,1,,ahk_exe EitherMouse.exe,,,,5000
 ActiveMouse := ErrorLevel
 If ActiveMouse = 1
  hHookMouse := SetWindowsHookEx(14, RegisterCallback("WH_MOUSE_LL", "Fast"))
 Else
  UnhookWindowsHookEx(hHookMouse)
Return

OnExit:
 UnhookWindowsHookEx(hHookMouse)
ExitApp

WM_EitherMouse(wParam,lParam) {
 global ActiveMouse
 ActiveMouse := lParam
 SetTimer, Invert, -200
}

Invert:
 If ActiveMouse = 1
  hHookMouse := SetWindowsHookEx(14, RegisterCallback("WH_MOUSE_LL", "Fast"))
 Else
  UnhookWindowsHookEx(hHookMouse)
Return

;=== DON'T EDIT BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING

WH_MOUSE_LL(nCode, wParam, lParam)  ;from the forum, by raccoon (i think)
{
  Static lx:=999999, ly
  Critical
  
  if !nCode && (wParam = 0x200) { ; WM_MOUSEMOVE 

    mx := NumGet(lParam+0, 0, "Int") ; x-coord
    my := NumGet(lParam+0, 4, "Int") ; y-coord
    ;OutputDebug % "MouseMove : mx = " mx ", lx = " lx ", my = " my ", ly = " ly
    
    if (lx != 999999) { ; skip if last-xy coordinates haven't been initilized (first move).

      ; normal movement example.
      ;mx := lx + (mx - lx)
      ;my := ly + (my - ly)
      
      ; modify (invert) movement.
;      mx := lx - (mx - lx)
;      my := ly - (my - ly)
      
      ; modify (half-speed) movement.
      ;mx := lx + (mx - lx) / 2
      ;my := ly + (my - ly) / 2

      ; modify (double-speed) movement.
      mx := lx + (mx - lx) * 2
      my := ly + (my - ly) * 2
    }

    ; This is where the magic happens, in combination with Return 1.
    DllCall("SetCursorPos", "Int", mx, "Int", my)
    VarSetCapacity(lpPoint,8)
    DllCall("GetCursorPos", "Uint", &lpPoint) ; SetCursorPos controls desktop edges; less math for us.
    lx := NumGet(lpPoint, 0, "Int")
    ly := NumGet(lpPoint, 4, "Int")
    
    ; Send the modified mouse coords to other hooking processes along the chain.
    NumPut(mx, lParam+0, 0, "Int")
    NumPut(my, lParam+0, 4, "Int")
    ret:=DllCall("CallNextHookEx", "Uint", 0, "int", nCode, "Uint", wParam, "Uint", lParam)
    Return 1 ; Halt default mouse processing. (same method used by 'BlockInput, MouseMove')
  }
  else {
    Return DllCall("CallNextHookEx", "Uint", 0, "int", nCode, "Uint", wParam, "Uint", lParam) 
  }
} ; End WH_MOUSE_LL

SetWindowsHookEx(idHook, pfn) {
  Return DllCall("SetWindowsHookEx", "int", idHook, "Uint", pfn, "Uint", DllCall("GetModuleHandle", "Uint", 0), "Uint", 0)
}
UnhookWindowsHookEx(hHook) {
  Return DllCall("UnhookWindowsHookEx", "Uint", hHook)
}
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

10 Dec 2020, 22:30

Thanks gwarble. I'm only a weak AHK coder. As far as I can tell, most of the code in DoubleSpeed has to do with limiting its action to mouse 1 — it would be far shorter for all mouses. Changing it to mouse 2 would be easy. But butchering it for all mouses is really beyond my ability. It would be truly appreciated if you did it for me.
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

11 Dec 2020, 10:36

looking closer at the code it was clearly a hack of another plugin for inverting an axis... I’ll clean up the code for all mice... Most of the code is for the low level mouse hook used to intercept the mouse input... i can see an issue where you would lose the ability to move a single pixel without making it more complicated

i guess to your point you dont really need an EitherMouse plugin, you could just run this alongside EitherMouse to take care of the difference between the two:

Code: Select all

#NoEnv
#SingleInstance, Force
#Persistent
SetWorkingDir %A_ScriptDir%
 OnExit, OnExit
 hHookMouse := SetWindowsHookEx(14, RegisterCallback("WH_MOUSE_LL", "Fast"))
Return

OnExit:
 UnhookWindowsHookEx(hHookMouse)
ExitApp

WH_MOUSE_LL(nCode, wParam, lParam)  ;from the forum, by raccoon (i think)
{
  Static lx:=999999, ly
  Critical
  if !nCode && (wParam = 0x200) { ; WM_MOUSEMOVE 
    mx := NumGet(lParam+0, 0, "Int") ; x-coord
    my := NumGet(lParam+0, 4, "Int") ; y-coord
    if (lx != 999999) { ; skip if last-xy coordinates haven't been initilized (first move).
      mx := lx + (mx - lx) * 2       ; modify (double-speed) movement.
      my := ly + (my - ly) * 2
    }
    ; This is where the magic happens, in combination with Return 1.
    DllCall("SetCursorPos", "Int", mx, "Int", my)
    VarSetCapacity(lpPoint,8)
    DllCall("GetCursorPos", "Uint", &lpPoint) ; SetCursorPos controls desktop edges; less math for us.
    lx := NumGet(lpPoint, 0, "Int")
    ly := NumGet(lpPoint, 4, "Int")
    ; Send the modified mouse coords to other hooking processes along the chain.
    NumPut(mx, lParam+0, 0, "Int")
    NumPut(my, lParam+0, 4, "Int")
    ret:=DllCall("CallNextHookEx", "Uint", 0, "int", nCode, "Uint", wParam, "Uint", lParam)
    Return 1 ; Halt default mouse processing. (same method used by 'BlockInput, MouseMove')
  }
  else {
    Return DllCall("CallNextHookEx", "Uint", 0, "int", nCode, "Uint", wParam, "Uint", lParam) 
  }
} ; End WH_MOUSE_LL

SetWindowsHookEx(idHook, pfn) {
  Return DllCall("SetWindowsHookEx", "int", idHook, "Uint", pfn, "Uint", DllCall("GetModuleHandle", "Uint", 0), "Uint", 0)
}
UnhookWindowsHookEx(hHook) {
  Return DllCall("UnhookWindowsHookEx", "Uint", hHook)
}
Last edited by gwarble on 11 Dec 2020, 11:53, edited 1 time in total.
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

11 Dec 2020, 11:51

And unrelated, but my main problem/source of feedback from users and potential users is false positive virus warnings. The last response I gave to a concerned user was something like:

Thanks for the feedback, unfortunately I haven't found a way to avoid the false positives from Microsoft and Google and others, you'll have to add the program as an exception (and submit it to your antivirus as a false positive classification please). I have not in over ten years ever found an actual virus on my site or within EitherMouse... In Chrome, click "Details" button and then "visit this site" if you believe me...

Sorry for the inconvenience,
- Joel

If i made any money with my software i feel like a lawsuit would be justified
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

11 Dec 2020, 16:44

gwarble wrote:
11 Dec 2020, 10:36
looking closer at the code it was clearly a hack of another plugin for inverting an axis... I’ll clean up the code for all mice... Most of the code is for the low level mouse hook used to intercept the mouse input... i can see an issue where you would lose the ability to move a single pixel without making it more complicated

i guess to your point you dont really need an EitherMouse plugin, you could just run this alongside EitherMouse to take care of the difference between the two:

Yeah, that's the sort of thing I was thinking of. I tried it and got this error:

Code: Select all

Error:  Call to nonexistent function.

Specifically: SetWindowsHookEx(14, RegisterCallback("WH_MOUSE_LL", "Fast"))

	Line#
	004: SetWorkingDir,%A_ScriptDir%
	005: OnExit,OnExit
--->	006: hHookMouse := SetWindowsHookEx(14, RegisterCallback("WH_MOUSE_LL", "Fast"))
	007: Return
	010: UnhookWindowsHookEx(hHookMouse)  
	011: ExitApp
	012: Exit

The program will exit.
Thanks -- Vincent
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

11 Dec 2020, 18:08

try downloading the latest AHK_L version 1.1.33.02
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

11 Dec 2020, 19:26

gwarble wrote:
11 Dec 2020, 18:08
try downloading the latest AHK_L version 1.1.33.02
I still get that error. I just installed the Unicode 32-bit version of 1.1.33.02. As I understand it all 1.1..... versions are AHL_L.
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

11 Dec 2020, 21:12

yes they are

did you make sure you copied the entire posted code? i don’t see any reason for that error but i will test when i get back to my computer
Edit: yeah start over, it works for me, maybe a copy/paste error
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

11 Dec 2020, 21:24

gwarble wrote:
11 Dec 2020, 21:12
yes they are

did you make sure you copied the entire posted code? i don’t see any reason for that error but i will test when i get back to my computer
I feel SO stupid. That was it exactly.

Thanks so much for your help -- Vincent
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

12 Dec 2020, 00:27

gwarble wrote:
11 Dec 2020, 10:36
looking closer at the code it was clearly a hack of another plugin for inverting an axis... I’ll clean up the code for all mice... Most of the code is for the low level mouse hook used to intercept the mouse input... i can see an issue where you would lose the ability to move a single pixel without making it more complicated

i guess to your point you dont really need an EitherMouse plugin, you could just run this alongside EitherMouse to take care of the difference between the two:

... <Code Snipped>
I have noticed that a few times the visible cursor disappears. I can still find it using the Ctrl trick and it still works. I can clear it with Ctrl-Alt-Del,

On a hunch, I thought it might be interference with AutoHideMouseCursor and, sure enough, I've had no problem after disabling it.

Note: AutoHideMouseCursor is a utility which will hide the cursor when over a playing a video. Years ago I found it very useful. Maybe Windows 10 handles this better. So far, I am happy with it disabled.

Edit: I take it back. I still get a disappearing cursor even with AutoHideMouseCursor off. Pretty annoying.

Edit: I've just discovered the Registry item HLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableCursorSuppression was ON, Have no idea what it is supposed to do, but I found many suggestions to turn it OFF to fix disappearing cursor problems. So I did and will see if it fixes my problem.
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

16 Dec 2020, 22:47

Hmm, interesting... Are you using the mirrored cursor option? If so I think there might be a problem with Windows 10 and animated cursors... If not, then I will have to investigate, never seen that reg key
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .
Kruskal
Posts: 12
Joined: 10 Dec 2020, 01:20

Re: EitherMouse 0.8 - Multiple mice, individual settings...

16 Dec 2020, 23:56

gwarble wrote:
16 Dec 2020, 22:47
Hmm, interesting... Are you using the mirrored cursor option? If so I think there might be a problem with Windows 10 and animated cursors... If not, then I will have to investigate, never seen that reg key
I did not select the mirrored cursor option. I turned it on just now and my cursor went from purple to white. Why "mirror"?

In one of my edits, I said that the RegEdit key turns out not to be relevant to my problem here.

I don't think I made this clear in my previous posts: When I reported the disappearing cursor problem, I was running both EitherMouse and the all mouse version of DoubleSpeed that you kindly wrote for me. But since then, I dropped DoubleSpeed thinking that my problem might be caused by the newer code, but it made no difference.

Thanks -- Vincent
User avatar
gwarble
Posts: 524
Joined: 30 Sep 2013, 15:01

Re: EitherMouse 0.8 - Multiple mice, individual settings...

17 Dec 2020, 09:21

mirror meaning left handed, ie mirrored across the x axis visually

so EitherMouse by itself with no other mouse utilities or ahk scripts running is making your cursor disappear? does it happen with windows dedault mouse cursor scheme? any behavior that seems to cause it?
EitherMouse - Multiple mice, individual settings . . . . www.EitherMouse.com . . . . forum . . . .

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: JoeWinograd and 125 guests