pavkam / sharpie

Terminal manipulation library based on Curses (ncurses, pdcurses and pdcurses-mod) for modern .NET applications.
BSD 3-Clause "New" or "Revised" License
23 stars 0 forks source link

SoftKeys #63

Open ClonedPuppy opened 1 year ago

ClonedPuppy commented 1 year ago

Hi, nice library! I was testing out the demos in your repo, and I can't seem to get SoftKeys to work, unless I use PdCursesMod, which in it's turn seem to have issues with the font in Visual Studio 2022 Dev Console (garbled characters and refresh issues as far as I can tell). PdCurses works fine and all demos do work without issues, just the slk demo that is problematic. So i guess my question is, is Softkeys only supported in PdCursesMod or is it supposed to be working in PdCurses and Ncurses as well?

Here's the error that's thrown: Sharpie.CursesOperationException: 'The call to slk_init failed: Failed to initialize soft label keys.'

pavkam commented 1 year ago

Hi @ClonedPuppy, thanks for giving the lib a try. To your question - PDCurses does not support SLK so it will fail, unfortunately. In relation to PDCursesMod - I found it to be the most stable across platforms (where NCurses is not available). But PDCursesMod has 3 "flavors" in Win32 - wincon, wingui and vt. Not sure which one you have used and what console/terminal settings you have. For the newer versions of Windows with VT support, the vt flavor should be the preferred option, otherwise, wincon will use the old-style Win32 console.

Probably a good enhancement is to auto-detect is the VT is turned on/can be turned on and select the appropriate flavor that way.

ClonedPuppy commented 1 year ago

Thank you for your reply! Interesting, I was testing your library in VS 2022, and using the Developer PowerShell as the terminal spawned in VS. I will poke around and see if I can get the PDCursesMod working properly with other settings or terminal.