Subj : Overriding InputLine keystrokes
To : All
From : Codefenix
Date : Thu Feb 13 2025 10:54 am
I'm working on some more modifications for Synchronet's MRC client. Would like to define some "hotkeys" to perform special functions similar to those in the Mystic version of the MRC client.
For example, pressing DEL should reset the mention counter and also let the user review previous mentions. I currently have KEY_UP handling this function, since KEY_DEL is apparently reserved as an alternate backspace key if I'm properly understanding the inputline.js library.
I'd also like KEY_ESC to clear the inputline buffer, so users don't need to repeatedly press or hold down backspace to clear the buffer themselves, but it would seem that this key isn't handled by inputline at all.
I noticed inputline.getkey() takes an optional use_hotkeys boolean, however setting this to true turns every key, even alphanumerics, into independent hotkeys as well, meaning A does something, B does something, etc., which obviously isn't wanted for typing long buffers of text.
Is there way to override or add certain keys as needed? If not, I think I can live with defining alternate keys, but was hoping to keep the feature and usage parity as close as possible to the other client.