I'm working on a project that's supposed to work on both Windows and Linux (with an unofficial Mac port as well) that emulates a true colour system console.

My problem is that recently there appeared a request for textfield support (yes, console-based) and it would be cool to add the possibility of copying text to clipboard and pasting from it. Is there a way of achieving this that will:

  • be done in C (not C++),
  • work in both Windows and in Linux (preprocessor macros are an option if there's no platform-independent code),
  • require no extra libraries to link to?

Thanks in advance for your help.

Edit
Report