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?
ESC is a bit problematic since ANSI escape sequences (e.g. for arrow keys) begin with the ESC character, so you need to have some kind of guard time to recognize the difference between an ESC key press and the start of an escape sequence.
It's all modifiable. There aren't a lot of users of this library (the author doesn't participate here too often), you mind find more feedback in IRC (#synchronet at irc.synchronet), but generally if your change is backward compatible, a merge request to gitlab.synchro.net would be accepted.
Sysop: | marcvandam |
---|---|
Location: | Utrecht |
Users: | 7 |
Nodes: | 4 (0 / 4) |
Uptime: | 42:20:05 |
Calls: | 71 |
Calls today: | 71 |
Files: | 72 |
U/L today: |
2 files (2,547K bytes) |
D/L today: |
133 files (77,973K bytes) |
Messages: | 5,211 |
Posted today: | 7 |