Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Ctrl to jump in OpenGL/GLUT?, can't use ctrl, shift, or alt
Unspecified
exenefevex
Posted: Jun 11 2008, 06:08 PM
Quote Post


Regular
[*][*][*]

Group Icon
Group: Members
Posts: 258
Member No.: 3660
Joined: 19-April 07

Status: (0d) [--]


I'm writing a game with OpenGL/GLUT and I've run into a little problem with input. The player is supposed to use left/right to move and Ctrl to jump. I can get arrow key input with glutSpecialFunc and glutSpecialUpFunc, and I've been led to believe that glutGetModifiers can catch the status of the Ctrl key. So far, so good.

Here's the problem: as far as I can tell, Ctrl does not trigger a callback function. I can't call glutGetModifiers except from within a keyboard or mouse callback, and I can't access the callback without hitting some other key besides Ctrl.

So, is there any possible way in GLUT to use the Ctrl key to jump, or will I have to make the transition to SDL a little sooner than expected?


--------------------
PM
Top
Canada
MegaTailzChao
Posted: Jun 11 2008, 06:23 PM
Quote Post


So long, and thanks for all the fish.
[S][*][*][*][*]
[*][*]

Group Icon
Group: Site Staff
Posts: 15788
Member No.: 2267
Joined: 2-July 06

Status: (0d) [--]


Either way I would not recommend control for jumping. It's just so...Awkward. Use shift instead if you can, please.


--------------------
user posted image
user posted imageuser posted image
PMEmail PosterMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0308 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.13 ]