-
April 1st, 2021, 07:38 AM
#1
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!
-
April 1st, 2021, 11:45 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|