Log in

View Full Version : MouseBroadcasting - Possible without focus change?



zanthor
10-27-2008, 09:00 PM
Is it possible to broadcast the mouse to other windows, relative positioning to current mouse positioning, without changing window focus?

olipcs
10-27-2008, 09:07 PM
i'm guessing, but if you use <SendWinM ..> this should be possible.
For more reference see: http://hotkeynet.com/ref/clickmouse.html

Metalocalypse
10-27-2008, 09:10 PM
Yes.

Look at the hotkeynet reference guide under ClickMouse for more information.

You could get some code like this:




<Hotkey LButton, RButton>
<SendLabel wow1, wow2, wow3, wow4, wow5>
<ClickMouse %TriggerMainKey%>

This will send left mouseclick or right mouse click resp to all 5 wow windows (again..just an example) without changing your current window.

olipcs
10-27-2008, 09:16 PM
...without changing your current window. Which is only true if you used a background-sending mode for your <Label...> definition, otherise it will bring it to the forground ;)

..but i'm a little bit of a smart ass here ;)

zanthor
10-27-2008, 09:36 PM
...without changing your current window. Which is only true if you used a background-sending mode for your <Label...> definition, otherise it will bring it to the forground ;)

..but i'm a little bit of a smart ass here ;)This is where I'm confused...

My goal is to send a relative mouseclick to all N windows without bringing them to foreground...

What I have thus far:


//================================================== ==============
// SAMPLE SCRIPT FOR FOUR WOW'S ON TWO PCs
//
// Instructions: Copy this entire script (all the blue writing
// on gray background including comments). Save it in a file.
// Load it into HotkeyNet.
//
// Toggle the scroll lock key to turn hotkeys off and on. (You
// can change this if you want, just like you can change
// everything else with HotkeyNet.)
//
// Requires HotkeyNet build 147 or higher.
//
// For more info, go to www.hotkeynet.com
//================================================== ==============

//-----------------------------------------------------------
// CTRL R WILL RENAME WOWS AFTER MANUAL LAUNCH
//-----------------------------------------------------------
<Hotkey ScrollLockOn Ctrl R>
<SendPC local>
<RenameWin "World of Warcraft" WoW1>
<RenameWin "World of Warcraft" WoW2>
<RenameWin "World of Warcraft" WoW3>
<RenameWin "World of Warcraft" WoW4>
<RenameWin "World of Warcraft" WoW5>


//-----------------------------------------------------------
// DEFINE A MAIL LABEL FOR EACH WOW
//-----------------------------------------------------------
<Label w1 Local SendWinM WoW1>
<Label w2 Local SendWinM WoW2>
<Label w3 Local SendWinM WoW3>
<Label w4 Local SendWinM WoW4>
<Label w5 Local SendWinM WoW5>


//-----------------------------------------------------------
// BROADCAST MOUSE CLICKS. HOLD DOWN OEM3 (ON U.S. KEYBOARDS,
// THAT'S THE SQUIGGLE KEY IN UPPPER LEFT CORNER) WHEN YOU
// WANT TO BROADCAST.
//-----------------------------------------------------------
<UseKeyAsModifier Oem3>
<Hotkey ScrollLockOn Oem3 LButton, MButton, RButton, Button4, Button5>
<SendLabel w1, w2, w3, w4, w5>
<ClickMouse %TriggerMainKey%>

This is pretty much directly yanked from the sample, it moves the mouse about, doesn't seem to reliably click... Ideally I'd like to have ctrl-R detect renamed and named windows, the only thing I'm using AHK for is the mouse broadcast.

Anemo
10-28-2008, 12:29 AM
Maybe try change the delay in hotkey to 100/100 under options > settings.

olipcs
10-28-2008, 04:09 AM
using AHK its HKN ;)

..the above script should do the job.
So, as Anemo suggested i would also try to change the hotkey delay beginning from 100/100.
If this works try to find out the magical frontier of the setting by tuning it down till it doesn't work ;)

Perhaps you could also use SendWinMF instead of SendWinM to see if it works.

Edit1:
Other idea: is scrolllok on on every computer you use, or do you need it at all?

Edit2:
More comments: If you mean by relative mouseclicks, that the mouseposition is scaled according to your window-size the above should work

zanthor
10-28-2008, 08:37 AM
AFter a bit of playing with those delays I got it to work on 3 of the 5 wows on one click then 2 of the 2 remaining on the 2nd click... I was clicking the exit button.

I'll have to screw with this a bit more, but right now my focus is on my druids leveling, 15 down, 45 to go...

Freddie
10-28-2008, 10:25 AM
Two things to make ClickMouse work reliably:

-- Raise ClickMouse Delays on Settings Panel.

-- Usually you get better performance if the spot that you're clicking in background windows is visible (not covered by other windows). Sometimes (depending on PC speed and number of WoWs) you need to do this, other times you can get away with not doing it.

Also, make sure you're using the current build of HotkeyNet because ClickMouse's peformance increased in a fairly recent build.

zanthor
10-28-2008, 11:28 AM
Two things to make ClickMouse work reliably:

-- Raise ClickMouse Delays on Settings Panel.

-- Usually you get better performance if the spot that you're clicking in background windows is visible (not covered by other windows). Sometimes (depending on PC speed and number of WoWs) you need to do this, other times you can get away with not doing it.

Also, make sure you're using the current build of HotkeyNet because ClickMouse's peformance increased in a fairly recent build.Unless you are hiding the current build on the website I have it (Downloaded fresh last night). The 5 windows are all fully visible, I run 1 @ 1680x1050 and the other 4 are scaled in a stack on the right side of my left monitor...

I am curious to know if there is a way to iterate through existing wows... some teams I play 4, some I play 5, it seems if I hardcode for 5 I'm throwing errors every time I play 4...

olipcs
10-28-2008, 11:37 AM
as long as i know, you can't iterate all existing windows.
The simplest way to do this, is haveing seperate hotkeyfiles..

Edit: ah, i think you can do it another way using: WinExists.
Try the follwoing:



<Hotkey ScrollLockOn Oem3 LButton, MButton, RButton, Button4, Button5>
<If WinExists WoW1>
<SendLabel w1>
<ClickMouse %TriggerMainKey%>
<EndIf>
<If WinExists WoW2>
<SendLabel w2>
<ClickMouse %TriggerMainKey%>
<EndIf>
<If WinExists WoW3>
<SendLabel w3>
<ClickMouse %TriggerMainKey%>
<EndIf>
<If WinExists WoW4>
<SendLabel w4>
<ClickMouse %TriggerMainKey%>
<EndIf>
<If WinExists WoW5>
<SendLabel w5>
<ClickMouse %TriggerMainKey%>
<EndIf>
..not elegant, but maybe working

Freddie
10-28-2008, 12:25 PM
Oh, one other thing about ClickMouse. Make sure "Substitute SendWinS for SendWinM with ClickMouse" is checked on the Settings Panel. It's supposed to be checked by default but maybe when I added it, there was a bug in the settings file code that screwed up. That code got added months ago but there was never a single bug report about it one way or the other so who knows.

Oli's solution works in this case because all your WoWs are on the local machine but other people should keep in mind that IfWinExists doesn't know about remote machines.

Red error messages from non-existent windows won't hurt anything in this case. I'm not sure whether red messages or If's would be faster but the difference is probably only a few millionths of a second so it doesn't really matter.