I've been stuck with my imac and I need GetAsyncKeyState();
I can't seem to find an alternative on google, any help?
I've been stuck with my imac and I need GetAsyncKeyState();
I can't seem to find an alternative on google, any help?
I guess I don't know the magic words to narrow my search to Mac programming on google, and I'm not entirely familiar with the mac API anyways, but I'm sure there's event handling. So you could implement your own, something like this:
and in the event loop:Code:bool keys[256] ... bool key_pressed(int keycode) { return keys[keycode]; }
This is the general idea anyway; hopefully my imaginary api doesn't get in the way too much.Code:if (event.type == keyboard_pressed) { keys[event.keycode] = 1; } if (event.type == keyboard_released) { keys[event.keycode] = 0; }
On the other hand, if you're working with a console application, you could use ncurses to switch the terminal to non-blocking i/o.
Or if you're working with opengl anyway you could throw in GLUT or GLFW(far better than glut) or the like to handle your input.
Consider this post signed