CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Cross-Platform Keyboard Input - How To?

  1. #1
    Join Date
    May 2019
    Posts
    41

    Cross-Platform Keyboard Input - How To?

    I'm coding a program that, ideally, will work on Windows AND Linux. I would also, as a bonus, like it to work on Android.

    I need a way to wait for keyboard presses from the user. Not using 'cin' but rather, live keyboard presses (checking to see if a key, any key is pressed, and reacting immediately, not waiting for the user to press Enter/Return).

    Are there any Cross-Platform ways of doing this? I'm using Conio.h but it is Windows only.

    Your assistance is greatly appreciated!

  2. #2
    Join Date
    Nov 2018
    Posts
    48

    Re: Cross-Platform Keyboard Input - How To?

    This will at least get you common code on Windows and Linux
    https://en.wikipedia.org/wiki/Ncurses

    I suppose it would work on Android as well if you installed a terminal emulator on it.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)