With all due respect, sir, I accuse you in being silent.
Guilty through pessimism, my apologies.
That said, wouldn't everything be OK if BearLibTerminal had these UI shortcuts simply enabled by default with an option to disable them? Like "input.alt-functions=false" and then you are on your own with that key? All these shortcuts are just conveniences, not a core feature. My previous questions (what are you doing and why) were to find out if there is something that might be better accounted for or integrated into these library tricks. If what you need is some 'raw access', then why not?
Yes that would work. Best would be if the default mapped functions could be accessed individually when the "input.alt-functions=false". In other words, rather than alt-enter (assumed default) switching full-screen, the same switch could be accessed via a menu in the application's UI.
An example of a custom mapping might be: CTRL-(1-9) sets a 'recall' position, ALT-(1-9) teleports to that position. Another might be a plugin that enables some plugin-defined behavior with a multiple SHIFT-ALT-(some key) sequence, or a user remapping of keybindings. Also, in a left-hand on keyboard, right-hand on mouse setup, the ALT-key is, at least on some keyboards, adjacent to the spacebar and easily thumb-accessible while other fingers are on 'main' keys (qwer-asdf-zxcv). In games (example ASCII-Sector) which combine both turn-based and real-time play (depending on mode), the difference between easy to reach ALT and (relatively) hard to reach CTRL may be significant.
If some mode allows ALT key both as key press and key modifier to be accessed then such custom mappings can easily be accomplished. ALT key as modifier being the most important for general use I believe. Would there be any harm in allowing ALT key as key press/key modifier even when input.alt-functions=true ?
Support for streamed/archived resources is something I lazily thought of (mostly because no one voiced it before) but there is some support already as BearLibTerminal can load images from in-memory buffers (look at relevant line in the sample). This is not complete: you cannot load TrueType fonts or text files (codepages) from memory =/. It would be nice to make possible to load resources from streams but I just cannot figure out how API for that should look like.
Oops, I missed that usage of terminal_setf. If I'm reading that sample correctly, then loading from stream to memory and then making the terminal_setf call would handle most reasonably sized bitmap files assuming the pixels are in the correct color format. Does that call result in the lib making an internal copy of the passed data, or does the application need to hold that data in memory after the call?
For TTF, there is a version of the FT_New_Memory_Face call that accepts a memory buffer address, so that may give an alternative entry point. Not sure about the code page text files although, given that they are likely to be a small file, a kludge fix might be to copy to a temp file and load that. Of course the same kludge could be done with TTF fonts.
For streams, yeah the interface would be a problem, especially given the multiple language mappings. Frankly I'd be happy with just using memory buffers as long as the expected format of the byte buffer and call are well defined. It would also be preferable I think if the lib made a copy of the passed buffers so that the caller could discard the buffer after the call to terminal_setf.
I'll try to be less silent in the future, maybe a bit more optimistic
Thanks,
Brian aka Omnivore