Page 2 of 8
Re: MouseEvent Plugin
Posted: Sat May 27, 2017 2:21 pm
by kgschlosser
Tho i have not used this plugin.
do the events for the wheel scrolling include payload data? and if so is the payload data a negative number for wheel down and positive for wheel up?
Re: MouseEvent Plugin
Posted: Sun May 28, 2017 7:15 am
by kgschlosser
ok so this is what you want to do to get the direction of the wheel. copy the code below and paste it into your tree this will generate the events for you.
I have also included an egplugin package that will work with EG 0.5 I am not sure if it will also work with EG 0.4 because the pyHook that is included states it's for python 2.7 but it still may work. there is no need to do anything else except double click the file. it will install all pieces necessary to run into c:\ProgramData\EventGhost\plugins\MouseEvent
One other thing is if you want it to start monitoring automatically you will need to add the action Start Mouse Event Listener into a macro with the event Main.OnInit with it. be sure to configure that action to generate events when you move the wheel
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="0.5.0-rc2">
<Macro Name="Mouse Wheel" Expanded="True">
<Event Name="MouseEvent.MouseWheel"/>
<Action>
MouseEvent.GetLastWheelEvent()
</Action>
<Action>
EventGhost.PythonScript(u"if 'Wheel' in eg.result:\n wheel = eg.result['Wheel']\n if wheel == 1:\n eg.TriggerEvent(prefix='MouseEvent', suffix='MouseWheel.Up')\n elif wheel == -1:\n eg.TriggerEvent(prefix='MouseEvent', suffix='MouseWheel.Down')\n ")
</Action>
</Macro>
</EventGhost>
Re: MouseEvent Plugin
Posted: Mon May 29, 2017 5:09 pm
by justahotbag2
Wooh... (Keanu Style) kgchlosser were you always the best? Perhaps, probably.
I'll try this right away, or work on it. ?From what you can tell from this plugin in order to have two conditions be true, do you think it will take some sort of scripting? I just want the mouse wheel to adjust things when near the top screen edge, so a range of like 0-5 pixels, so scripting, yes? I'll figure it out, if you're too busy.
I'm unsure what you're scripting added, but this seems to be added functionality, not just a lack of documentation. Thank you, good sir.
Also judging by the two downloads already it seems you may have helped some others. Perhaps those people would consider saying thank you. This mans effort is slightly more than holding open a door for you, and you'd say thank you then, yes? I'll be starting a thank you thread to encourage people to do just that. (Soon as I figure out the perfect title.)
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 1:04 am
by justahotbag2
Well just when I thought I knew how to do something as simple sounding as copy & paste into the EG tree, I feel particularly stupid just typing that out. But I just borked the hell out of my setup, luckily I had a backup, and now backup and running.
I'm running EG 0.4.1r1722
So I first installed your posted copy of the plugin, then I opened notepad++ and pasted your code on to nearly the end of my tree, into the macro section of the MouseEvent plugin, and all hell broke loose, with the tree not loading and red errors galore. Oops, I figured I hadn't removed the previous version of the plugin, so removed it, no good, then I realized yours was for EG 0.5, like you mentioned and installed plugins in a different location, so I moved it manually, still no good. I switched it back, leaving just the original plugin. I also tried removing the opening and closing
<EventGhost Version="0.5.0-rc2">
</Eventghost>
Well because they were already in the tree...
Basically I tried like all the things.
This is becoming the mis-adventures of an EG idiot.
Just when I gather some courage, and momentum in trying to refine my setup, I embarrass myself.
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 3:37 am
by kgschlosser
No no. Literally copy the code. Then right click on your tree. In EventGhost and paste. You do not need to edit your save file. Literally paste it into your tree. The thing that is typically on the right. Supposed to look like branches on a tree. With pretty little icons and what have you. LOL
EG will convert the above XML code automatically into macros and events and actions.
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 1:13 pm
by Diz
not trying to hijack someone elses thread... but pasting into the tree like this has NEVER worked for me... paste is always greyed out! i always have to paste directly into the tree file!

Re: MouseEvent Plugin
Posted: Tue May 30, 2017 1:21 pm
by justahotbag2
Yea... I had actually tried that first before editing the xml directly, but the option to paste is greyed out, no matter where I click, can't drag it in either. I going to assume this isn't "normal" so I'm going to try rushing my move of EG to a netbook running win10, plus upgrade to 0.5.0 and see what happens there.
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 1:23 pm
by justahotbag2
Diz wrote:pasting into the tree like this has NEVER worked for me... paste is always greyed out! i always have to paste directly into the tree file!

Thanks, thought I'd be alone on that.
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 3:29 pm
by kgschlosser
you do not need to multiload. if the touchscreens act as mouse input (which is sounds like they do) then there is a possibility this will work. are the 4 screens sharing the same desktop? or is the desktop extended across them? this is what is going to be the deciding factor. because if you extend the desktop then the monitors are stacked with the primary monitor top left corner being 0, 0 for a starting position and the bottom right being the end resolution of that monitor.
as an example if you have 3 2000 x 1000 set resolution monitors. and their orientation is in a horizontal line. and the monitors are numbered from left to right 1, 2, 3, 4 and monitor number 2 is the primary. then the positional order will be as such
you will have to excuse the crude artwork below.
the numbers represent width, height this is the positional coordinates for the corners of the monitors
Code: Select all
-2000, 0 0, 0 2000, 0 4000, 0 6000, 0
| | | | |
| 1 | 2 | 3 | 4 |
| | | | |
-2000, 1000 0, 1000 2000, 1000 4000, 1000 6000, 1000
and if they are stacked with the primary being number 4
Code: Select all
-2000, -1000 0, -1000 2000,-1000
| | |
| 1 | 2 |
| | |
-2000, 0 0, 0 2000, 0
| | |
| 3 | 4 |
| | |
-2000, 1000 0, 1000 2000, 1000
if all of the monitors share the same desktop (mirroring) then it would have to be gone after a different way. I would have to think about how to specifically choose which mouse to monitor. I do not know if this is even possible. because each physical mouse device has it's own translator if you will a driver that interprets the input and then passes it to the Windows API for a mouse. and since there is only one cursor or mouse on the screen then there is really no way to tell which one is doing what. because there is no easy way to be a go between for the driver and API without making a kernel mode driver. which has to be signed by microsoft and that's a whole other thing.
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 5:22 pm
by justahotbag2
BTW@Diz do you do anything special when pasting directly in to the EG tree. I can't see what I did wrong, other than it possibly not being compatible with 0.4 EG.
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 8:32 pm
by kgschlosser
ok make an empty folder. and then right click the folder and maybe then you can click paste. I should have included the folder in the example
here it is with a folder. try copying and pasting this
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="0.5.0-rc2">
<Folder Name="Mouse Wheel" Expanded="True">
<Macro Name="Mouse Wheel">
<Event Name="MouseEvent.MouseWheel"/>
<Action>
MouseEvent.GetLastWheelEvent()
</Action>
<Action>
EventGhost.PythonScript(u"if 'Wheel' in eg.result:\n wheel = eg.result['Wheel']\n if wheel == 1:\n eg.TriggerEvent(prefix='MouseEvent', suffix='MouseWheel.Up')\n elif wheel == -1:\n eg.TriggerEvent(prefix='MouseEvent', suffix='MouseWheel.Down')\n ")
</Action>
</Macro>
</Folder>
</EventGhost>
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 8:34 pm
by kgschlosser
if you right click on the computer at the top you will be able to paste it directly into the root of the tree, otherwise you have to right click a folder
Re: MouseEvent Plugin
Posted: Tue May 30, 2017 8:36 pm
by kgschlosser
maybe it's because of the eventghost version at the top. copy and paste on of your existing tree items and paste the code into notepad and copy the eventghost version into this one and see if that solves it
Re: MouseEvent Plugin
Posted: Wed May 31, 2017 2:40 am
by Diz
@justahotbag2... anything special? not really... you just have to make sure you put it in the right section and that the indents and section start/end markers are in the right place
Re: MouseEvent Plugin
Posted: Wed May 31, 2017 2:47 am
by Diz
&kgschlosser... it doesnt matter where i right click in the tree, root, new folder or anywhere because paste is ALWAYS greyed out! even with the new section you posted.