Do you think UTF-16/32 encoded files should also be supported? (since it will be a bit of a hassle).
No, but it may be worth detecting them and throwing/returning an error to the user.
As for newlines, it is an oversight and it may or may not work depending on where you place that newline. I'll fix and document this in the next update.
Cool
I'm loading the initial settings from an external file, while I can strip the line endings, it'd be nice I think for future users if it wasn't necessary.
The idea is that value of TK_CHAR may be used to determine whether last stroke was textual or not.
Good. I'm processing the input and sometimes grabbing the value when I don't really need it just to simplify the code, was more worried about causing an internal error accidentally.
For some uses in C#, the list of const int TK_XXX symbols in BearLibTerminal.cs would be much better represented as a public enum outside the Terminal class, say as public enum TerminalKeys {...}.
A lot of constants represent both an input event and a state, e. g. TK_A which may be returned by Read and also may be tested by State/Check. It's either using one single enum or duplicate a lot of constants in separate enums. And one huge list just does not look like enum since its values not equally meaningful within same context. C# is not my area of expertise, so I may miss some fundamental feature or strict community preferences here, but this list of constants does not seem that bad =_=.
While I wouldn't call it bad in this case, I believe it is considered 'C# best practice' to use enums instead of lists of constants. In my particular use case, I'm making use of the ability to get a string name from the enum by its value. I turn the input events into string descriptors (plus extra data for char value, mouse position, etc) which then is used in a user configurable command table. It allows an easy to implement key map file with lines of the form: "T.CONTROL = JUMP_SIDEWAYS".
Being able to use the enum to turn the integer value into a string ("TK_T" in this case) and then strip the "TK_", add the ".CONTROL" if the control key state is true, etc. Having the values of a long list in a C# enum saves a lot of typing which could potentially introduce errors. Its not a major issue since you can do as I've done and simply cut and paste the list of integer constants into an enum, but that is a potential maintenance problem if the constants are expanded or changed - probably not much of a chance of that in this case.
Anyhow, thanks for doing this library
It fits in quite well with the data structures I'm using and since I had a 'layers' variable for the imaging already, its nice to be able to use it for something other than a sort order key! Also the guy that's been doing artwork for me will be glad to hear that he can stack tiles and layers since that seems to be the common practice in the portion of the graphics industry he works in.