glkote icon indicating copy to clipboard operation
glkote copied to clipboard

GlkApi notes

Open curiousdannii opened this issue 2 years ago • 7 comments

GlkApi's gli_get_line doesn't add a NULL byte.

Also, just to check my understanding of the spec, if it reads a line break, that line break should be copied to the buffer and then a NULL, not replaced by the NULL, right?

curiousdannii avatar Nov 30 '22 05:11 curiousdannii

Huh, yeah. That's a fun thing to not notice for decades.

if it reads a line break, that line break should be copied to the buffer and then a NULL, not replaced by the NULL, right?

Right.

erkyrath avatar Nov 30 '22 16:11 erkyrath

Towards the bottom of glk_window_close it tries to set box = content_box;, but there is no content_box in the file.

This must mean that that branch is never run. And so the whole keydamage_flag stuff is unncessary?

curiousdannii avatar Dec 08 '22 05:12 curiousdannii

It looks like glk_cancel_line_event doesn't convert non-Latin1 characters into ?s for a non-unicode buffer.

It's also not very clear whether non-Latin1 characters should be converted before or after echoing.

GlkApi trims the input to the buffer length before echoing it. Is this required by the spec, or can I echo first, then trim?

Also, RemGlk doesn't support partial inputs at all?

curiousdannii avatar Dec 08 '22 05:12 curiousdannii

The GlkOte docs say that terminator keys can only be escape or func1-12, but GlkApi allows any special keycode. GlkApi also doesn't ignore return?

As RemGlk only allows what the GlkOte docs say, I'm going to take this as a GlkApi bug rather than a GlkOte docs mistake.

But the Glk spec seems to just say it could be any special keycode...

curiousdannii avatar Dec 08 '22 06:12 curiousdannii

glk_gestalt says buffer windows instead of grid windows support mouse input.

curiousdannii avatar Dec 09 '22 01:12 curiousdannii

I can't see anywhere that dialog.js cleans up temp files. Or it could just use sessionStorage for temp files.

TIL: most OSes don't clean up temp files automatically either!

curiousdannii avatar Dec 27 '22 07:12 curiousdannii

@erkyrath Thinking about the terminator keys again... I assume you originally designed it to be able to do what the Z-Machine spec says? But there's quite a lot of inconsistency between the terps. Is there any reason not to support as much as possible though?

GlkApi: all special keycodes RemGlk: escape and func1-12 Garglk: escape and func1-12 Windows-Glk: escape, pageup/down, func1-12

curiousdannii avatar Apr 15 '24 14:04 curiousdannii