There's already an ON KEYDOWN event, but it works only in @win editbox not in #channel editbox.
Right, I remember that when I added this in 1999, I limited it and its related events to custom @windows as I didn't like the idea of scripts interfering with normal windows. Twenty years later, I may be a little more open to the possibility :-)
However, such a change could lead to backward compatibility issues.
First: I can make the event trigger in all windows, not just @windows. If an older script has used the @ window prefix in the event definition, it will work as expected. But if it has used *, this will cause it to trigger in all windows, including status, queries, channels, etc.
Second: currently, using /halt in on KEYDOWN/etc. will only halt the TAB key. I could change it so that it halts all key presses, in effect allowing a script to manage all key presses in a window. This would affect most keys and shortcuts, such as Up/Down, Control+C, Escape, and so on. If an older script uses /halt in @windows, expecting it to only halt TAB, it will in fact block all keyboard input. If it happens to use * as the window prefix and uses /halt, it will block all input to all windows.
I am going to experiment with this and may include changes in the next beta.