Something like this is very easily done with AutoHotkey, the script would be like:
fireToggle = 0
#IfWinActive, ahk_class CryENGINE
; Remap Right Mouse to alternate between 1+2 and 3+4
RButton::
if (fireToggle = 0){
Send {12}
fireToggle = 1
} else {
Send {34}
fireToggle = 0
}
return
#IfWinActive
Unfortunately, as MWO stands, it will not work.
It seems that MWO detects key presses for some in game controls in a different way to others.
Weapon groups cannot be programmed, but some other keys (Night vision, zoom etc) can.
For example, if I rewrite that script so that instead of firing weapon groups 1+2 then 3+4, to toggling between night or thermal vision, it works.
In fact, if you keep the weapon script above as is, and open a chat window in MWO then hit the right mouse button, you see 1,2,3,4 being typed into the chat by the macro.
Now this may be simply because of the way the game happens to work that the detection for some time-critical controls are handled in other ways, or it may be to do with a deliberate attempt to block such things (eg gameguard).
Personally, I do not agree with a policy of blocking macros that simply affect interface. People will always have access to programmable keyboards and mice that you cannot block - so just let AutoHotkey etc work so that the playing field is level.
Edited by evilC, 31 December 2012 - 07:57 AM.