A few things I notice at first glance,
I usually register my packets in my main constructor, don't know if that's relevant.
Why do you have a static boolean for if the key is pressed, your keybind most likely won't work in multiplayer if you use it.
The int parameter in your key class is completely useless, you should remove it.
I think ctx.get.setPacketHandled(true) should always be called, whether or not your requirement was met, call it at the end of the handle method.