Rick Murray's ErrorCancel module in Pyromaniac

by gerph
macOS ◆ xterm-256color ◆ fish 1077 views

I stumbled across Rick Murray’s ErrorCancel module and thought it’d be a good test for whether my Wimp_ReportError implementation actually worked as it expected.

Turns out, it didn’t, because I’d not even written the Service_WimpReportError calls in my implementation. They still had FIXME: Service_WimpReportError in the code. I shoved in a call to the API so that those services were raised and loaded Rick’s module - the result is this recording.

After issuing the Wimp_ReportError call, I didn’t touch the keyboard - as expected 5 seconds later, an escape was triggered and the error cancelled!

This worked with the Pyromaniac vdu WimpReportError implementation, because it works entirely with the VDU stream and calls OS_ReadC to get the user’s response. It doesn’t work with the null implementation (because that always returns cancel immediately), and it doesn’t work with the easygui implementation because that blocks in the host system, so the ticker event is never triggered. But the default implementation works now!