最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c - Windows kbhit() has weird wide char issues - Stack Overflow

programmeradmin1浏览0评论

I'm writing a simple chat program and i'm using conio's _kbhit() with _getwch() to get input from user.

The problem is when I enter altgr combinations (like altgr-s for letter 'ś' in Polish programmers keyboard) the terminal window becomes invisible, but the process is still running (responds to sockets and is visible in task manager). I'm setting the locale to ".UTF8"

Due to my testing I'm sure it's the problem with _kbhit() and not _getwch().

I don't want to switch to PDCurses because I use the windows api and i don't think mixing is a good idea.

I'd maybe go with PeekConsoleInputW() and ReadConsoleInput() but when I tried them the program has noticeable input lag and there was still problems with polish letters

Anyone had that problem before, how did you sort it out? Is there a kbhit() alternative?

发布评论

评论列表(0)

  1. 暂无评论