After fixing this bug will someone also modify all "recieve" words in the file with "receive"!?
I fixed that.
Regarding the code, look at the result assignment of function LCLSendCharEvent, the function above LCLSendUTF8KeyPress. Notice that it's result is also the result of DeliverMessage, like most of the function results in that file. There's no guarantee that the result is always zero but most of the times it is. LCLSendUTF8KeyPress never returns zero, always returns a one result, which is completely unnatural, another source of bugs. Both functions are designed to send characters, both functions return PtrInts, functions one on top of the other, in the same file. Imagine having an UTF8Pos function implemented that would return a different value than the traditional pos function when the search returns nothing.
If the patch is accepted, LCLSendUTF8KeyPress will return zero if the key(TUTF8Char) was not handled because that's also the result of LCLSendCharEvent when the key is delivered without problems, and will return 1(a non-zero value) when the key was handled because that's when the key has been only partially delivered(equivalent of not fully/completely sending the message). Regarding result assignments, LCLSendUTF8KeyPress will try to mimic the behavior of LCLSendCharEvent, having the same zero and non-zero results(not exactly the same non-zero results, you get it).
Regarding the comment included in the patch, it has been added knowing that all comments regarding the returned values of the functions in that file have a significant flaw: the comments say what the caller functions should do with the messages based on the returned values instead of saying what is the meaning of the returned values(the results) for the called functions.
For example, "Returns : 0 to accept the message, non-zero to reject the message" has a different meaning than "Returns : 0 for success, non-zero for error code" or "for failure" or "for status code" or "for handled". They are not equivalent.
This is something that will have to be fixed in the entire file and will probably be a subject of it's own at a later time. The comment in the patch can be ignored because LCLSendCharEvent doesn't have a comment on top of it either. It has been added because when someone will decide to update those comments in that file, it should be easier for him.