What to use instead of GetAsyncKeyState(…) in g++ compiler?

I write program with eclipse in ubuntu and cross g++ compiler,when I include #include <windows.h> return error: fatal error: windows.h: No such file or directory for use arrow key in program directly what to use instead of GetAsyncKeyState(...) or how fix this problem??

1
2
3
4
5
6
if(GetAsyncKeyState(VK_RIGHT)) {
//	val = digitalRead(inPin);   // read the input pin
//	  digitalWrite(RPin, val);
	digitalWrite(RPin, HIGH);  
	delay(1000);                       // waits for a second
	digitalWrite(RPin, LOW);
Last edited on
Can I use ncurses library in linux?? why when use #include <curses.h> I have same error . according to other site I should linke gcc main.c -lncurses how do this in eclipse on linux , I new in c ??what should I do?
Last edited on
You should only use <> when includingsystem heders. For everything else include with ""
I do this :|
There is no such header #include <windows.h>
     but there is a header #include <Windows.h>
Last edited on
I know that but my problem is eclipse doesn't Windows.h library at all
Why would the windows API be available on ubuntu
Last edited on
what's your mean??I don't understand
<Windows.h> is the header for the Windows API. As in... it's the MS Windows operating system.

Ubuntu is Linux, not Windows. So if you're writing a program for Ubuntu you're not going to have anything from Windows available. It's an entirely different OS.

You'll have to find something similar in one of the APIs for Ubuntu... or use a cross-platform library like GTK.
Last edited on
I get arrow key with sacnf() ,witch Character define arrow key ??with out using conio.h or windows.h or ncurses.h library ???any one know??
@Disch tank you, I know it and I said what to use instead of this
Topic archived. No new replies allowed.