GLUT using modifier keys alone
Hi, I'm currently using GLUT keyboard funcs and i ran into a small problem. Is there a way to detect the modifier keys such as "ALT", "SHIFT", "CTRL" but without having to detect a normal key? Basically, is there a way to use only alt, shift or ctrl without having to press it with another key?
I have seen that page already, but as i said, the only way to actually process modifier keys is if it's detected to be pressed with a normal key such as "r" or something like that. Is it possible to just detect the alt key pressed by itself and make it a case?
Is something sorta like this possible:
void keyboardfunc(unsigned char, int x, int y){
int r=glutGetModifiers();
if (r==GLUT_ACTIVE_ALT)
do something;
}
so basically, i'm checking if only the alt is pressed, is it possible?
Is something sorta like this possible:
void keyboardfunc(unsigned char, int x, int y){
int r=glutGetModifiers();
if (r==GLUT_ACTIVE_ALT)
do something;
}
so basically, i'm checking if only the alt is pressed, is it possible?
Congratulations, you've outgrown GLUT. Time to move on.
Indeed. Try SDL.
You can stick to glut but handle your keyboard input with GetKeys() (assuming you are working in Carbon). This will allow you to check for any key state on the keyboard. Check out developer.apple.com for the iGetKeys sample code.
There's an example of how to use Carbon events on the source code at http://webpages.charter.net/utopiaplanet...Struct.dmg
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Using GLUT With Multitouch and Command Keys | Rasterman | 7 | 7,552 |
Feb 10, 2010 07:40 PM Last Post: Rasterman |
|
Is this how multiple keys are typically handled? | WhatMeWorry | 2 | 3,910 |
Oct 12, 2006 01:02 PM Last Post: szymczyk |