View Full Version : Multiple Keyboard presses?
In nehe's tuts they describe a way to check if more than one key is pressed at once.
How do i make this in linux?
If i press up and left at the same time it will just go left.. =(
/Emil "Eaglez" Forsmark www.neuxsoftware.com (http://www.neuxsoftware.com)
I use the SDL library for nice input stuff (joysticks, mice, keyboard). Maybe it will help you too: www.libsdl.org (http://www.libsdl.org)
Originally posted by Eaglez:
In nehe's tuts they describe a way to check if more than one key is pressed at once.
How do i make this in linux?
If i press up and left at the same time it will just go left.. =(
/Emil "Eaglez" Forsmark www.neuxsoftware.com (http://www.neuxsoftware.com)
Thanx for the answer.
Can you mail me some examples? plz =)
/Emil Forsmark
Try:
http://www.libsdl.org/docs/events/examples.html http://www.libsdl.org/demos.html http://www.libsdl.org/games_db/games.php3 http://www.libsdl.org/apps.html
Originally posted by Eaglez:
Thanx for the answer.
Can you mail me some examples? plz =)
/Emil Forsmark
[This message has been edited by rts (edited 02-13-2001).]
One way to perform it, it's to used the glut key up function. You just have a global variable for each key you want to press. If the event key down is activated, change the state of the variable to press and perform the action into a idle function. When you detect the key is up, re-change the state to un-activated.
Hope it's help.
Vince
Originally posted by Eaglez:
In nehe's tuts they describe a way to check if more than one key is pressed at once.
How do i make this in linux?
If i press up and left at the same time it will just go left.. =(
/Emil "Eaglez" Forsmark www.neuxsoftware.com (http://www.neuxsoftware.com)
tfpsly
02-26-2001, 07:17 AM
GL has its own keyboard function, one called when a key is pushed, one called when a key is released (Same name with "Up" in addition).
Just keep in memory if your left/right/... keys are is pushed staight or not.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.