This is for those of us who happen to own a Logitech G15 keyboard.
I've always found the default behaviour of the G keys to be rather limited, since there are only 18 of them, so you have to move your hand back and forth between the main qwerty set of keys and the macro one all the time. So instead, I use G keys as modifiers for the numpad. This gives me a much greater number of macros and lets me group commands according to the type of action.
For example, I can move in several different ways: leap, walk, sprint, fly. By assigning each method of movement to a G key (G13 for leaping, G14 for flying, etc) I can switch movement methods with those keys, while still using the numpad for actually moving around.
Previously, getting this to work involved some tedious and ugly hacking in G15's macro editor but the 2nd version of the firmware introduced Lua scripting, which makes this much simpler and more flexible.
All you have to do to set this up on the keyboard's side is copy/paste the following snippet into Logitech's script editor for your Mushclient profile:
Save it and assign "Script" to all the G keys in the profile.
On Mushclient's side you need to install the plugin below and edit the modifier rule tables, as explained in the plugin's description.
I've always found the default behaviour of the G keys to be rather limited, since there are only 18 of them, so you have to move your hand back and forth between the main qwerty set of keys and the macro one all the time. So instead, I use G keys as modifiers for the numpad. This gives me a much greater number of macros and lets me group commands according to the type of action.
For example, I can move in several different ways: leap, walk, sprint, fly. By assigning each method of movement to a G key (G13 for leaping, G14 for flying, etc) I can switch movement methods with those keys, while still using the numpad for actually moving around.
Previously, getting this to work involved some tedious and ugly hacking in G15's macro editor but the 2nd version of the firmware introduced Lua scripting, which makes this much simpler and more flexible.
All you have to do to set this up on the keyboard's side is copy/paste the following snippet into Logitech's script editor for your Mushclient profile:
function OnEvent(event, arg)
--OutputLogMessage("event = %s, arg = %s\n", event, arg);
if event == "G_PRESSED" then
PressKey(0x1d, 0x38)
PressAndReleaseKey("a")
ReleaseKey(0x1d, 0x38)
local m,g = tostring(GetMKeyState()), tostring(arg)
PressAndReleaseKey("m", m, "k")
string.gsub(g, "(%d)", function(mt) PressAndReleaseKey(mt) end)
PressAndReleaseKey("enter")
PressKey(0x1d, 0x38)
elseif event == "G_RELEASED" then
ReleaseKey(0x1d, 0x38)
local m,g = tostring(GetMKeyState()), tostring(arg)
PressAndReleaseKey("e", m, "k")
string.gsub(g, "(%d)", function(mt) PressAndReleaseKey(mt) end)
PressAndReleaseKey("enter")
PressKey(0x1d, 0x38)
PressAndReleaseKey("z")
ReleaseKey(0x1d, 0x38)
end
end
Save it and assign "Script" to all the G keys in the profile.
On Mushclient's side you need to install the plugin below and edit the modifier rule tables, as explained in the plugin's description.