Did you use "wine start testprog" or "wineconsole testprog" or something else?
Whoa. As I rarely use Wine, I did not even know about wineconsole. Indeed, after running the snippet application this way, it behaves more like under native Windows and WaitForSingleObject does not hang now. Though output still differs from that under Windows. Wine 1.4 under Ubuntu 12.04:
Keyrelease (I think it is keyrelease) of the modifier key is doubled so Ctrl+A looks like:
11-00-08
41-01-08
41-01-08
11-00-00
11-00-00
Depending on the release order (key or modifier released first), this doubled line moves accordingly but somehow mingles with normal ones, e. g. Shift+A:
Shift down, A down, A up, Shift up | but Shift down, A down, Shift up, A up
10-00-10 | 10-00-10
41-41-10 | 41-41-10
41-41-10 | 10-41-00
10-00-00 | 10-00-00
10-00-00 | 41-00-00
Where I honestly see only chaos.
Alt+A differs only slightly:
12-00-02
41-61-02
41-61-02
12-00-00
12-00-00
The alternative libraries don't seem to have current D wrappers.
I specifically designed BearLibTerminal's API to simplify wrapping for another languages. If you are interested in this pseudoterminal output approach, I'll make a wrapper for D. Also, BearLibTerminal works fine under Wine (well, at least where I was able to test it).
Get curses <...>
I do not really understand this pure terminal way. It's harder to set up properly. In its extreme it requires networking for no real game purpose. In the end it just shifts the drawing responsibility from external library to external application. And even while using external tools for output it still severely restricts output functionality. Telnet games are cool in their own way but they are harder both ways, requiring more effort from both programmer and player.