Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

MouseEvent Plugin

Questions and comments specific to a particular plugin should go here.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MouseEvent Plugin

Post 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?
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MouseEvent Plugin

Post 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>
Attachments
MouseEvent.egplugin
(26.62 KiB) Downloaded 121 times
If you like the work I have been doing then feel free to Image
justahotbag2
Experienced User
Posts: 68
Joined: Fri Jan 27, 2017 8:16 pm
Location: New York, NY

Re: MouseEvent Plugin

Post 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.)
justahotbag2
Experienced User
Posts: 68
Joined: Fri Jan 27, 2017 8:16 pm
Location: New York, NY

Re: MouseEvent Plugin

Post 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.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MouseEvent Plugin

Post 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.
If you like the work I have been doing then feel free to Image
Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: MouseEvent Plugin

Post 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! :lol:
justahotbag2
Experienced User
Posts: 68
Joined: Fri Jan 27, 2017 8:16 pm
Location: New York, NY

Re: MouseEvent Plugin

Post 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.
justahotbag2
Experienced User
Posts: 68
Joined: Fri Jan 27, 2017 8:16 pm
Location: New York, NY

Re: MouseEvent Plugin

Post 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! :lol:
Thanks, thought I'd be alone on that.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MouseEvent Plugin

Post 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.
If you like the work I have been doing then feel free to Image
justahotbag2
Experienced User
Posts: 68
Joined: Fri Jan 27, 2017 8:16 pm
Location: New York, NY

Re: MouseEvent Plugin

Post 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.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MouseEvent Plugin

Post 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>
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MouseEvent Plugin

Post 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
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: MouseEvent Plugin

Post 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
If you like the work I have been doing then feel free to Image
Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: MouseEvent Plugin

Post 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
Diz
Experienced User
Posts: 121
Joined: Tue Jan 10, 2017 4:49 pm

Re: MouseEvent Plugin

Post 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.
Post Reply