Page 5 of 8

Re: MouseEvent Plugin

Posted: Thu Jul 06, 2017 7:54 am
by kgschlosser
OK I have updated this plugin.

simply double click it to install

Added wheel up and down events.
Added horizontal wheel left right events (pushing the wheel from left to right)
Added up/down Events to all of the buttons
Added button 4 up/down events (forward)
Added button 5 up/down events (back)

depending on the behavior of your mouse you may get a down and up event even if you are holding the button this applies to button 4 and button 5
if the window you have in focus has no horizontal bar you may get wheel up and down events when pushing the wheel left or right

I also added double click support but this doesn't appear to be working. it may with another mouse. it could simply be the mouse I am using doesn't have driver that will generate these kinds of notifications (that's what i get for buying a logitech performance MX).

I have also made it so that when this plugin starts it will shut down the mouse events generated by EventGhost as this would become obsolete

Re: MouseEvent Plugin

Posted: Sun Jul 09, 2017 11:40 pm
by farbox
Tried installing your new version, with latest version of EG, and still getting an error below:

Error loading plugin file: C:\Program Files (x86)\EventGhost\plugins\MouseEvent
Traceback (most recent call last) (0.5.0-rc3):
File "C:\Program Files (x86)\EventGhost\plugins\MouseEvent\", line 103, in <module>
ImportError: No module named pyHook.HookManager

Cant understand why...

Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 8:42 am
by topix
Inside the MouseEvent plugin folder is a folder pyHook. Copy or move this folder to lib27\site-packages\ inside the EventGhost program folder.

Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 3:39 pm
by kgschlosser
you shouldn't have to move the folder. it should work right form there.


Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 5:54 pm
by topix
I've changed the way the plugin imported pyHook. Now the plugin loads without moving the pyHook folder (at least for me it works :wink: )

Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 7:07 pm
by kgschlosser

The problem is with the way the import is done now it doesn't override the MouseEvent like it should so you don't get the back and forward events. I am going to tinker with it a bit and see if there is a way I can get it to function properly.

Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 7:20 pm
by topix
Hmm, if it doesn't overwite correctly, what would not work? Any misbehaviour?

After adding the plugin and running the 'enable MouseEvents' macro i've got events and they all looked correct.

Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 9:10 pm
by kgschlosser
give this one a shot guys. i am sorry about the one i posted earlier. I forgot I had pyHook in my Python installation and it would load form there. that is my fault. This one will make sure that it loads only the pyHook that is included with the plugin. and it will do the override correctly as well so the forward and back buttons work. And I also fixed it restarting the original mouse plugin if this one is stopped.

TY topix for the import fix unfortunately you didn't know the odd coding that had to be done to override the MouseEvent in the HookManager module. the import in the __init__ of pyHook was a * import you can't override it from pyHook.MouseEvent because that is not the same one that pyHook.HookManager.HookManager is seeing. that is why I had to use sys.modules to make sure I was grabbing the proper one form the HookManager module it's self.

Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 9:11 pm
by kgschlosser
the events for the forward and back buttons. buttons 4 and 5. I also think the wheel left and right as well tho i forgot to test those and they would only show up properly if the window you have in focus has a horizontal scroll bar other wise they will show up as a wheel up and down. which is correct behavior because it does in fact move the vertical bar if there is no horizontal bar.

Re: MouseEvent Plugin

Posted: Mon Jul 10, 2017 10:50 pm
by farbox

Now the installation is working fine!
Thanks guys, and now I will try to get it to do what I want!


EDIT: Unfortunately it didnt detect the side wheel click on my Logitech MX revolution, which is what I needed it for... :-(
But at least we got the install sorted! :-)

Re: MouseEvent Plugin

Posted: Tue Jul 11, 2017 3:36 am
by kgschlosser
it does work for the side wheel click I have the same mouse. you have to be over a windows that has a horizontal scroll bar otherwise it will show up as wheel up and down. and this is windows that does this no way around that. Tho i do have the Logictech API dll file and I am going to start playing with that and see if I can get a plugin going that will detect all the buttons on the Logitech mice. including the MX Air with gestures and z axis also. I am going to have to make another dll to access the thing tho as i do not have the source file for it and I do not know what the actual function calls are.

Re: MouseEvent Plugin

Posted: Tue Jul 11, 2017 11:58 am
by kgschlosser
well.. that was a no go on the API I got for Logitech. turns out it is 10 years old and they have no made a new one and the only thing that kinda works it the getting of the resolution. tho i do not know if it is reporting the proper amount. so my search continues. I have found some documentation on the unifying HID** messages. and these i may use to see if i can capture buttons 7+ on the mice.

Re: MouseEvent Plugin

Posted: Sat Jul 15, 2017 3:00 pm
by justahotbag2
Is this update not compatible with EG 0.4 r1722, or is it just me? I'm just making notice of it, since that has been my experience. Even after a manual install to 1722's usual plugin location.

However since someday, I'll figure out my EG 0.5 issues, I would just like to inquire about a feature request, I can't even be sure isn't already there.
Would it be possible to allow for keyboard and mouse combinations to be detected?

Things like ctrl/alt/shift +right click, +mouse scroll, mouse movement (maybe perhaps and this is asking a lot, it could support drawn mouse gestures, maybe a baby plugin that integrates with "StrokePlus" (a mouse gesture program) if that is easier, it's not for me, but would maybe be great for newcomers to EG. Maybe also increase it's accessibility for mousey PC users. Some can draw shapes with a mouse better than they can remember/press key combinations.)

I personally could really use the alt+mouse scroll.
P.S. I appreciate the pants off of kgschlosser, in at this point a semi-sexual fashion for improving a plugin, I believe he barely uses himself. I have a favorite 7-button mouse in disrepair, to soon be repaired, but he inspires me to add to cart an 18 button giga-mouse. Just to see if it would work... I could definitely think of uses for that amount of buttons.

Re: MouseEvent Plugin

Posted: Sat Jul 15, 2017 8:48 pm
by kgschlosser

Holy crap you are asking a lot!.

Yeah I guess I can kick in the key combinations. Tho I am going to have to really play around with it because we do not want it interfering with Windows and in the past this has been a problem of sorts with the Keyboard plugin. But it will give me the opportunity to learn the keyboard side of things.

And unfortunately the Windows API only has concessions for these buttons.

Button 1 (Left)
Button 2 (Right)
Button 3 (Middle/Wheel)
Button 4 (Page Forward)
Button 5 (Page Back)
Wheel Up
Wheel Down
Wheel Left
Wheel Right

So if there are any buttons besides those then their specific use is done through the software the manufacturer provides. But with logitech I would have to reverse engineer the protocol they use and some how end up being a man in the middle between the device and the software. This would take some time of which at the moment i do not have.

Re: MouseEvent Plugin

Posted: Sun Jul 16, 2017 2:20 pm
by kgschlosser

well I have added the keystrokes to the mouse events. but for some reason pyHook does not like capturing the keyboard and mouse at the same time. I am not sure what the issue is bet it keeps on getting tracebacks for the message identifier coming from windows is not an integer. and it is completely random when it happens. but it seems to happen more often if you hold down a key on the keyboard or a button on the mouse. so it is going to take me a while longer to get it going as i am going to have to modify pyHook to see what is going on.