Right, the second integer parameter for TriggerRegisterKeyEvent and TriggerRegisterMouseEvent is not

*key*, it's

*etype*, that was a typo (fixed now).

Possible

*etype* values for TriggerRegisterKeyEvent:

JASS:

constant integer EVENT_KEYUP = 0
constant integer EVENT_KEYDOWN = 1
constant integer EVENT_KEYTYPE = 2

And for TriggerRegisterMouseEvent:

JASS:

constant integer EVENT_LMOUSEUP = 0
constant integer EVENT_LMOUSEDOWN = 1
constant integer EVENT_RMOUSEUP = 2
constant integer EVENT_RMOUSEDOWN = 3
constant integer EVENT_MMOUSEUP = 4
constant integer EVENT_MMOUSEDOWN = 5
constant integer EVENT_MOUSEWHEEL = 6

Attached the new common.j with these constants defined, but you can just type the numbers directly if you want.