Closed cage2 closed 4 years ago
Hello, that is a good catch. Thank you for all the work youre doing!
The function "function-key" which accesses the alist hasnt been adapted to wide characters at all, it is very old from a time where I only considered narrow chars. Refactoring all of it to focus on wide chars is on my todo-list, but I have been busy with other things...
I have to think about what would be a clear way to unify the narrow and wide APIs at the same time.
On Sat, Jan 04, 2020 at 05:35:21AM -0800, McParen wrote:
Hello, that is a good catch. Thank you for all the work youre doing!
Thaks to you for this library, i am actually writing a software using it and i feel pleasant working with it! :)
The function "function-key" which accesses the alist hasnt been adapted to wide characters at all, it is very old from a time where I only considered narrow chars. Refactoring all of it to focus on wide chars is on my todo-list, but I have been busy with other things...
I can understand, i wish i had more time working for my free software project! :(
I have to think about what would be a clear way to unify the narrow and wide APIs at the same time.
Very well, if you need help just let me know! :)
Bye! C.
Hello, I think that the function "function-key" which get-wide-event calls to get the key name, should not return nil in the first place when it encounters an unknown code. It should return the name if it finds one in the alist or the code if it cant find the name.
This will in the end have the same effect as your suggestion. Since we do not need unknown-event-as-nil then, i'll close the PR.
On Sat, Jan 04, 2020 at 12:46:44PM -0800, McParen wrote:
Hi!
Hello, I think that the function "function-key" which get-wide-event calls to get the key name, should not return nil in the first place when it encounters an unknown code. It should return the name if it finds one in the alist or the code if it cant find the name. This will in the end have the same effect as your suggestion. Since we do not need unknown-event-as-nil then, i'll close the PR.
And i think this is a much better solution! I used the special variable (admittedly a workaround) just to keep the old behaviour for the function.
Thank you for this improvement!
Bye C.
Hi!
'get-wide-event' return nil if an event is not present in 'key-alist' i think this could be changed to return the unknown event as int and letting the user-code deal with it instead of giving the impression that the key fired no event.
This could be useful even for debugging purposes, i guess.
the return type can be changed using a special variable: 'unknown-event-as-nil' that if non-nil (the default) use the old behaviour.