Bug in /bind when using utf-8? Is there a way around this?
Jani Saksa <[email protected]> Sun, 14 Mar 2010 13:29:55 +0200
| Newsgroups | gmane.network.irc.irssi.user |
|---|---|
| Message-ID | <[email protected]> |
Warning, this post got a bit long - it starts with complaint about obvious bug on how keybinds are handled and then I have possible plan and questions about scripting a workaround for it... Here goes: It seems to me that irssi has problem understanding keybindings for any characters outside plain ASCII alphabets when using utf-8. I use a swedish variant of DVORAK (SVORAK) layout and have previously using latin1 charset binded keys for windows 11-19 accordingly which in case of this variant means I have binds meta-å, meta-ä and meta-ö that don't work now. I have shell account to run irssi on server where I have no right to change charset but I made some tests on my home computer - the bindings are shown correctly just as well when using utf-8 as with iso8859-1 - they just don't work with utf-8. Obviously this seems to be a bug in how irssi handles utf-8 and bindings - however there could maybe still be a workaround, especially as I'm a programmer and can work on scripts too.... I just don't know enough about irssis internals and about script API/signals to know for sure if it's possible, but I have an idea. Actually first about a script I made where I'd like to do some magic if possible until this gets properly fixed in irssi: I also made a script to provide command for switching these bindings between QWERTY and SVORAK layouts (so I can get comfortable bindings loaded fast when not connecting from home) - and I added support for several other layouts planning to release the script to public but I think I will wait until this is fixed or I can use a workaround... Now, I'd like to know if a trick I have in mind would be possible by scripting and any possible information about how to do it: First, I believe it possible to hook into some signal so when a key is pressed my function would be called and it could check from keycode if it's a should-be-binded key. This I think is possible, I recall seeing something like that with irssi but two things I don't know: The code I recall seeing did not react to modifier keys - will the keycode be different if meta/alt was used with it? Or is it possible to know about it some other way? And for last part, if the above is possible and I get to the point where script should react and do what the binding should have done can I then stop irssi from reacting to the keypress like it would normally? The solution is not good if for example the window changes as it should but the character will still appear in the input-area like regularily (or something else)? -- Peace&Love, Jani "robsku" Saksa HackNBlog: http://salamanteri.homelinux.net/wordpress/