GLUT using modifier keys alone

n00bprogrammer
Unregistered
 
Post: #1
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?
Quote this message in a reply
Member
Posts: 110
Joined: 2002.07
n00bprogrammer
Unregistered
 
Post: #3
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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Congratulations, you've outgrown GLUT. Time to move on.
Quote this message in a reply
n00bprogrammer
Unregistered
 
Post: #5
eh? move on?
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #6
Indeed. Try SDL.
Quote this message in a reply
Tobi
Unregistered
 
Post: #7
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.
Quote this message in a reply
Member
Posts: 156
Joined: 2002.11
Post: #8
There's an example of how to use Carbon events on the source code at http://webpages.charter.net/utopiaplanet...Struct.dmg
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Using GLUT With Multitouch and Command Keys Rasterman 7 4,456 Feb 10, 2010 07:40 PM
Last Post: Rasterman
  Is this how multiple keys are typically handled? WhatMeWorry 2 2,770 Oct 12, 2006 01:02 PM
Last Post: szymczyk