Log in

View Full Version : Bind question



Ghallo
11-11-2009, 09:03 PM
I may be mistaken, but I remember long ago seeing a /bind command that you could use to switch keybindings in-game. For some reason the search function doesn't like this term. What I am looking to do is to change the keybindings for the movement keys from a script.

While I am considering moving to HKN, I currently use Octopus. Since Octopus is the one system that does not allow for "hit key Alt-Shift-R on main, send key 1 on Slave1 and Slave2, but not Slave3 or Slave4" this is compounded by the fact that Octopus cannot properly send Up, Down, Left, Right when sent from an X-Keys keyboard (The stars aligned for me... not... the one setup/config that doesn't work). (it is a complicated story I won't get into here).

Additionally, I have a 128 key X-Keys (yay). I have 4 sets of 6 directional keys (so I can move each slave 100% isolated. I have another set of 6 that moves all 6 together (but not my main) and 4 keys for "formation" (which sends Up to Slave1+Slave2, while sending Down to Slave3+Slave4).

Ok, that's out of the way. Here's the issue:
I want to move on to having different teams (leveling team 2 now), and I want the toon in the bottom right to be controlled by the bottom right set of XKeys (makes sense, right?). However, if I switch a toon to a different screen space, I want to change the bindings in a relatively painless fashion. I was thinking (and I am probably wrong) of something that looked like:
Place the following into a single Macaroon button:
//Toon TopRight:
/script setbinding("Ctrl-Alt-i",strafeleft);
/script setbinding("Ctrl-Alt-o",moveforward);
/script setbinding("Ctrl-Alt-p",straferight);
/script setbinding("Ctrl-Alt-k",turnleft);
/script setbinding("Ctrl-Alt-l",movebackward);
/script setbinding("Ctrl-Alt-;",turnright);

/script setbinding("Ctrl-Alt-t","--need comment to unbind");
/script setbinding("Ctrl-Alt-y","--need comment to unbind");
/script setbinding("Ctrl-Alt-u","--need comment to unbind");
/script setbinding("Ctrl-Alt-g","--need comment to unbind");
/script setbinding("Ctrl-Alt-h","--need comment to unbind");
/script setbinding("Ctrl-Alt-j","--need comment to unbind");

Then this goes into another separate Macaroon button:
//Toon TopLeft:
/script setbinding("Ctrl-Alt-t",strafeleft);
/script setbinding("Ctrl-Alt-y",moveforward);
/script setbinding("Ctrl-Alt-u",straferight);
/script setbinding("Ctrl-Alt-g",turnleft);
/script setbinding("Ctrl-Alt-h",movebackward);
/script setbinding("Ctrl-Alt-j",turnright);

/script setbinding("Ctrl-Alt-i","--need comment to unbind");
/script setbinding("Ctrl-Alt-o","--need comment to unbind");
/script setbinding("Ctrl-Alt-p","--need comment to unbind");
/script setbinding("Ctrl-Alt-k","--need comment to unbind");
/script setbinding("Ctrl-Alt-l","--need comment to unbind");
/script setbinding("Ctrl-Alt-;","--need comment to unbind");
... etc for all 4 toons.

Then, if a toon is in the top left, I click the button for top left (out of combat if necessary) and now all the bindings are set for that toon.

Here's the question:

Is this possible
If possible, what's the correct syntax/method?

Ghallo
11-12-2009, 02:24 AM
Interesting, lots of views, no responses. I got home from work and figured this out (in case anyone is interested):
TopLeft


/script SetBinding("ALT-CTRL-m","STRAFELEFT");
/script SetBinding("ALT-CTRL-,","MOVEFORWARD");
/script SetBinding("ALT-CTRL-.","STRAFERIGHT");
/script SetBinding("ALT-CTRL-p","TURNLEFT");
/script SetBinding("ALT-CTRL-;","MOVEBACKWARD");
/script SetBinding("ALT-CTRL-BACKSPACE","TURNRIGHT");
/script SetBinding("ALT-CTRL-z","--nil");
/script SetBinding("ALT-CTRL-x","--nil");
/script SetBinding("ALT-CTRL-c","--nil");
/script SetBinding("ALT-CTRL-r","--nil");
/script SetBinding("ALT-CTRL-t","--nil");
/script SetBinding("ALT-CTRL-y","--nil");
/script SetBinding("ALT-CTRL-f","--nil");
/script SetBinding("ALT-CTRL-g","--nil");
/script SetBinding("ALT-CTRL-h","--nil");
/script SetBinding("ALT-CTRL-v","--nil");
/script SetBinding("ALT-CTRL-b","--nil");
/script SetBinding("ALT-CTRL-n","--nil");
/script SetBinding("ALT-CTRL-u","--nil");
/script SetBinding("ALT-CTRL-i","--nil");
/script SetBinding("ALT-CTRL-o","--nil");
/script SetBinding("ALT-CTRL-j","--nil");
/script SetBinding("ALT-CTRL-k","--nil");
/script SetBinding("ALT-CTRL-l","--nil");
/script SetBinding("SHIFT-LEFT","STRAFELEFT");
/script SetBinding("SHIFT-RIGHT","STRAFERIGHT");
/script SetBinding("CTRL-LEFT","STRAFELEFT");
/script SetBinding("CTRL-RIGHT","STRAFERIGHT");
/script SetBinding("CTRL-DOWN","MOVEBACKWARD");
/script SetBinding("CTRL-UP","MOVEFORWARD");
/script SaveBindings();

TopRight


/script SetBinding("ALT-CTRL-m","--nil");
/script SetBinding("ALT-CTRL-,","--nil");
/script SetBinding("ALT-CTRL-.","--nil");
/script SetBinding("ALT-CTRL-p","--nil");
/script SetBinding("ALT-CTRL-;","--nil");
/script SetBinding("ALT-CTRL-Backspace","--nil");
/script SetBinding("ALT-CTRL-z","STRAFELEFT");
/script SetBinding("ALT-CTRL-x","MOVEFORWARD");
/script SetBinding("ALT-CTRL-c","STRAFERIGHT");
/script SetBinding("ALT-CTRL-r","TURNLEFT");
/script SetBinding("ALT-CTRL-t","MOVEBACKWARD");
/script SetBinding("ALT-CTRL-y","TURNRIGHT");
/script SetBinding("ALT-CTRL-f","--nil");
/script SetBinding("ALT-CTRL-g","--nil");
/script SetBinding("ALT-CTRL-h","--nil");
/script SetBinding("ALT-CTRL-v","--nil");
/script SetBinding("ALT-CTRL-b","--nil");
/script SetBinding("ALT-CTRL-n","--nil");
/script SetBinding("ALT-CTRL-u","--nil");
/script SetBinding("ALT-CTRL-i","--nil");
/script SetBinding("ALT-CTRL-o","--nil");
/script SetBinding("ALT-CTRL-j","--nil");
/script SetBinding("ALT-CTRL-k","--nil");
/script SetBinding("ALT-CTRL-l","--nil");
/script SetBinding("SHIFT-LEFT","STRAFELEFT");
/script SetBinding("SHIFT-RIGHT","STRAFERIGHT");
/script SetBinding("CTRL-LEFT","STRAFERIGHT");
/script SetBinding("CTRL-RIGHT","STRAFELEFT");
/script SetBinding("CTRL-DOWN","MOVEBACKWARD");
/script SetBinding("CTRL-UP","MOVEFORWARD");
/script SaveBindings();

BottomLeft


/script SetBinding("ALT-CTRL-m","--nil");
/script SetBinding("ALT-CTRL-,","--nil");
/script SetBinding("ALT-CTRL-.","--nil");
/script SetBinding("ALT-CTRL-p","--nil");
/script SetBinding("ALT-CTRL-;","--nil");
/script SetBinding("ALT-CTRL-Backspace","--nil");
/script SetBinding("ALT-CTRL-z","--nil");
/script SetBinding("ALT-CTRL-x","--nil");
/script SetBinding("ALT-CTRL-c","--nil");
/script SetBinding("ALT-CTRL-r","--nil");
/script SetBinding("ALT-CTRL-t","--nil");
/script SetBinding("ALT-CTRL-y","--nil");
/script SetBinding("ALT-CTRL-f","STRAFELEFT");
/script SetBinding("ALT-CTRL-g","MOVEFORWARD");
/script SetBinding("ALT-CTRL-h","STRAFERIGHT");
/script SetBinding("ALT-CTRL-v","TURNLEFT");
/script SetBinding("ALT-CTRL-b","MOVEBACKWARD");
/script SetBinding("ALT-CTRL-n","TURNRIGHT");
/script SetBinding("ALT-CTRL-u","--nil");
/script SetBinding("ALT-CTRL-i","--nil");
/script SetBinding("ALT-CTRL-o","--nil");
/script SetBinding("ALT-CTRL-j","--nil");
/script SetBinding("ALT-CTRL-k","--nil");
/script SetBinding("ALT-CTRL-l","--nil");
/script SetBinding("SHIFT-LEFT","STRAFELEFT");
/script SetBinding("SHIFT-RIGHT","STRAFERIGHT");
/script SetBinding("CTRL-LEFT","STRAFELEFT");
/script SetBinding("CTRL-RIGHT","STRAFERIGHT");
/script SetBinding("CTRL-DOWN","MOVEFORWARD");
/script SetBinding("CTRL-UP","MOVEBACKWARD");
/script SaveBindings();

BottomRight


/script SetBinding("ALT-CTRL-m","--nil");
/script SetBinding("ALT-CTRL-,","--nil");
/script SetBinding("ALT-CTRL-.","--nil");
/script SetBinding("ALT-CTRL-p","--nil");
/script SetBinding("ALT-CTRL-;","--nil");
/script SetBinding("ALT-CTRL-Backspace","--nil");
/script SetBinding("ALT-CTRL-z","--nil");
/script SetBinding("ALT-CTRL-x","--nil");
/script SetBinding("ALT-CTRL-c","--nil");
/script SetBinding("ALT-CTRL-r","--nil");
/script SetBinding("ALT-CTRL-t","--nil");
/script SetBinding("ALT-CTRL-y","--nil");
/script SetBinding("ALT-CTRL-f","--nil");
/script SetBinding("ALT-CTRL-g","--nil");
/script SetBinding("ALT-CTRL-h","--nil");
/script SetBinding("ALT-CTRL-v","--nil");
/script SetBinding("ALT-CTRL-b","--nil");
/script SetBinding("ALT-CTRL-n","--nil");
/script SetBinding("ALT-CTRL-u","STRAFELEFT");
/script SetBinding("ALT-CTRL-i","MOVEFORWARD");
/script SetBinding("ALT-CTRL-o","STRAFERIGHT");
/script SetBinding("ALT-CTRL-j","TURNLEFT");
/script SetBinding("ALT-CTRL-k","MOVEBACKWARD");
/script SetBinding("ALT-CTRL-l","TURNRIGHT");
/script SetBinding("SHIFT-LEFT","STRAFELEFT");
/script SetBinding("SHIFT-RIGHT","STRAFERIGHT");
/script SetBinding("CTRL-LEFT","STRAFERIGHT");
/script SetBinding("CTRL-RIGHT","STRAFELEFT");
/script SetBinding("CTRL-DOWN","MOVEFORWARD");
/script SetBinding("CTRL-UP","MOVEBACKWARD");
/script SaveBindings();



Observations: This is case-sensitive. ALT-CTRL needs to be allcaps, etc. The keys need to be "manually" unbound from any ui/addons otherwise they will not work.

Ualaa
11-12-2009, 03:14 AM
I had no clue how to do this, so did read the thread, but had nothing constructive to contribute.

Fizzler
11-12-2009, 03:16 AM
Useful stuff here.

Ghallo
11-12-2009, 05:12 AM
A couple new notes after doing some experimentation...

1. This is really not fun to setup the first time. Due to the 1024 character limit in Macaroon this needs to be bound to multiple buttons (I used 3 per toon, and cascaded the buttons with a /click MacaroonButton# )
at least it is better than the 255 limit in the bliz macros!
2. Instead of unbinding the buttons, it is better to specifically bind them to a non-action. For example, I have Macaroon set to have button 117 invisible, but with keybinds (blank button). I then put:

/script SetBindingClick("ALT-SHIFT-m","MacaroonButton117","LeftClick");
to cancel "Alt-Shift-M" so that it will do nothing. Otherwise, if Shift-M is mapped ... your toon will fire off Shift-M when you hit your movement key.

Here's the new TopLeft as an example:
TopLeft
Button1 (the only one you ever click/use):


/script SetBinding("ALT-SHIFT-m","STRAFELEFT");
/script SetBinding("ALT-SHIFT-,","MOVEFORWARD");
/script SetBinding("ALT-SHIFT-.","STRAFERIGHT");
/script SetBinding("ALT-SHIFT-p","TURNLEFT");
/script SetBinding("ALT-SHIFT-;","MOVEBACKWARD");
/script SetBinding("ALT-SHIFT-BACKSPACE","TURNRIGHT");
/script SetBinding("ALT-SHIFT-q","STRAFELEFT");
/script SetBinding("ALT-SHIFT-e","STRAFERIGHT");
/script SetBinding("ALT-SHIFT-a","STRAFELEFT");
/script SetBinding("ALT-SHIFT-d","STRAFERIGHT");
/script SetBinding("ALT-SHIFT-w","MOVEBACKWARD");
/script SetBinding("ALT-SHIFT-s","MOVEFORWARD");
/click MacaroonButton61

Button2 (MacaroonButton61):


/script SetBindingClick("ALT-SHIFT-z","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-x","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-c","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-r","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-t","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-y","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-f","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-g","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-h","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-v","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-b","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-n","MacaroonButton117","LeftClick");
/click MacaroonButton65

Button3 (MacaroonButton65)::


/script SetBindingClick("ALT-SHIFT-u","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-i","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-o","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-j","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-k","MacaroonButton117","LeftClick");
/script SetBindingClick("ALT-SHIFT-l","MacaroonButton117","LeftClick");
/script SaveBindings();

Bettysue
11-12-2009, 10:43 AM
Wait a tick here I'm just trying to wrap my head around what's going on.

You essentially have 4 arrow keypads and dependent upon which one you are using you want the chars to do something different.
Why do you have the need to unbind and rebind when you could just bind the different configs for all 4 inputs, considering the "keys pressed physically" are different for each keypad?

You do know that you can bind any number of keys to one action, you are only restricted from binding 1 key to several actions...

For example

Use the setbinding script to set

STRAFELEFT to ALT-CTRL-m, ALT-CTRL-z, SHIFT-LEFT, ALT-CTRL-u


////nvm none of that is helpful, this is way easier to accomplish in HKN, if you need some help getting started let me know or send a PM to paradox (me) over on the HKN forums. Sorry for wasting space in the thread the above info may be useful to someone just not you :( Sorry I couldn't help.

BTW None of the scripts/macros you posted above will work in combat. Setbinding is a NOCOMBAT restricted API function :(

Ghallo
11-12-2009, 02:39 PM
Wait a tick here I'm just trying to wrap my head around what's going on.

You essentially have 4 arrow keypads and dependent upon which one you are using you want the chars to do something different.
Why do you have the need to unbind and rebind when you could just bind the different configs for all 4 inputs, considering the "keys pressed physically" are different for each keypad?

You do know that you can bind any number of keys to one action, you are only restricted from binding 1 key to several actions...

For example

Use the setbinding script to set

STRAFELEFT to ALT-CTRL-m, ALT-CTRL-z, SHIFT-LEFT, ALT-CTRL-u


////nvm none of that is helpful, this is way easier to accomplish in HKN, if you need some help getting started let me know or send a PM to paradox (me) over on the HKN forums. Sorry for wasting space in the thread the above info may be useful to someone just not you :( Sorry I couldn't help.

BTW None of the scripts/macros you posted above will work in combat. Setbinding is a NOCOMBAT restricted API function :(

Just to clarify (hopefully :) )
You are correct, I essentially have 4 sets of "direction" pads. Historically, I spent about 20-30 minutes getting a toon "movement configured" to work with this setup. So, I would always keep my priest in the bottom-left window and my bottom left direction pad would move my priest. The problem is, when I want to move a different toon into that spot (say I want to try a shaman this week) then I need to configure movement for another 20-30 minutes.

While this will not work in combat, that isn't really the issue I am trying to solve. It's more the long term configuration changes.


As for HKN... it doesn't look as easy to setup as Octopus, but it certainly is more powerful. Switching systems means at least a week of downtime (since no matter how I set it up, I'll constantly find little things I messed up that I need to fix).

If only the 2 could be combined :(

Actually ... is there a way to use the PiP swapping to also redifine keybinds?

Ualaa
11-12-2009, 07:47 PM
With ISBoxer, you can create sets of Keymaps.
The default is General, Control and FTL DPS.
But you can make your own.

You can also have Keymaps enable or disable individual Keymaps or groups of Keymaps.

I'm not sure what the equivalent is in HKN, but have been told if you can think of what you want, there's a way for HKN or IS to do it.

Create four sets of Keymaps.
Call them TopLeft, TopRight, BottomLeft and BottomRight.
Have all of the binds you want within each set.

When a given toon switches to whatever region.
On the keybind which controls the PiP swap.
Have a Keymap, which controls the state of the four sets of Keymaps.
It will enable one and disable the other three.

Something to that effect, would be my guess.

Bettysue
11-12-2009, 09:53 PM
Ya for use with HKN it would be pretty simple. Bind the movement keys in WoW to WASD or the arrows like you would playing on a single standard keyboard with a single standard character.
Then tell HKN to convert your X-Keys definiton to one of the movement keys you bound in WoW.
For switching in new characters to new positions, just have HKN rename the window dependent upon it's position on screen and like magic your char in the bottom left will move with the bottom left direction keys you have defined on your X-keys.

For instance my current formation setup works like this:
Press Shift+W
w1 gets up arrow sent and moves forward
w2 gets left arrow sent and strafes left
...
w5 get nothing and I now have a cross formation

In your case it would be more like
Press bottom left keys on X-keys and it sends Shift-left
HKN takes the shift left and know this means move bottom left screens char.
so it send the left arrow to bottom left WoW
the character would then move according to its in game keybinding.

HKN script would look like:
<Label w4 local SendWinM WoW4> // these labels are really just a shorcut so you can always refer to a certain window with a shorter easier to remember name
<Hotkey Shift Left> //This is always the physical key pressed -- in your case it would be the output from X-Keys
<Sendlabel w4> // This tells HKN which window(s) are going to receive the key
<key left> // This is the key that WoW will see

I guess it's really just adding the ability to determine which characters receive the keys that differentiates things like HKN, IS and KC from Octopus. I do like your method for overcoming this though it's actually quite clever.

Having never used Octopus I don't know if it's possible to blacklist or ignore certain keypresses, but if it is then you could indeed use HKN and Octopus together, reducing the total setup/conversion time, and you could slowly migrate away from Octopus as you added in keys on HKN. ISBoxer and KC would both be able to accomplish this as well actually, given the abilty for Octopus to ignore certain keys/key combos that are physically pressed.

If you PM me a list of a few things I could send you a script that you should be able to pretty much plug and play.
I would need:
Layout -- how you want the screens displayed sizes locations how many monitors and resolution of monitors. --if Octopus handles this I need to know if it renames the windows at all, and if not I would need to know if I could rename the windows.
The desired actions related to key presses on X-keys and the output related to the actions (bottom left X-key direction pad sends shift left move bottom left char to the left) I could get most of this from your post above if thats the setup you have.
How many comps you play on

With that info I could get a movement script set up for you in a few minutes.

daviddoran
11-12-2009, 10:00 PM
so is this how you could set your keybinds so that, for instance your leader has the arrow keys unbound, but the alts have those bound? I'm still using a focus leader, but researching a true FTL setup. I'm getting more serious into pvp and lost a couple arena matches after i lost my main, but probably still could have won had I still been mobile. Side note, targeting from "spectator" view in arenas does work....

Bettysue
11-12-2009, 10:33 PM
If you can avoid switching keybinds in the game and just switch which keys get sent to the particular instance, you'll be much better of as it isn't affected by combat restrictions.

Ghallo
11-13-2009, 02:45 AM
Bettysue is correct - the combat restriction on this would be death in PvP.

Bettysue - I'll send a PM when I get all my specs in order - I certainly appreciate the offer of help! My wife is working tonight and I need to play while I have the chance :D

Final note... I found that Jamba (the god of all addons ... gotta love it!) really helps with this setup.
If you go into Jamba Macro, this can all be done with 6 total macros.

Create 4 macros named:

TL,TR,BL,BR
(Top Lef, Top Right ... etc)

Create 2 macros named:

ClearMovement
ClearMovement2

Download the .zip file (I think that's easier than posting a huge list of script calls)
Change the yellow fields (in the .zip) to match the setup you want.
Copy the gray "Output" section to each of the Macros you created in Jamba
Create a new bar in Macaroon. I used 2 columns, 6 buttons
For the very top left, I use for my master to "unbind" all. Edit the button and call:

/click JMB_ClearMovement
/script SaveBindings(2);

For the button to the right of that, I figured out the id (in this case MacaroonButton120) and left it blank
For the next 4 buttons I used edit and called:

/click JMB_TL
/click JMB_TR
/click JMB_BL
/click JMB_BR

After just go into Jamba-Macro, click "Use" at the top right ... and you should be all set with your new keybinds.
Again, these will not work in combat.