Results 1 to 5 of 5

Thread: How to map the key board without using windows.h

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    India
    Posts
    7

    How to map the key board without using windows.h

    Hi Folks,
    I am trying to map the key board (arrow and + - keys) for my application developed in OGL.
    I want to do it without using "windows.h"
    Please suggest me, how I should go about it..
    Thanks,

    Amol

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: How to map the key board without using windows.h

    Hi !

    I am not sure what you want to do, if you want to be "platform independent", then you are already possibly using GLUT/SDL or some other library and thoose have builtin platform independent keyboard management, if you don't have this and you are making a Win32 application, then you already have to include windows.h to get anything done so why not use it ?

    Or am I missing something here ?

    Mikael

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2002
    Location
    India
    Posts
    7

    Re: How to map the key board without using windows.h

    Hi Mikael,
    thanks for replying..

    Actually I an very new in OGL field..
    I developed an application using GLUi, which is having functions for zoom in/out and pan.
    I can use this with the help of mouse. But I want to control the same by using arrow keys and + - keys..
    now can u guide me which function may solve my purpose ??
    thanks once again

    Amol

    Originally posted by mikael_aronsson:
    Hi !

    I am not sure what you want to do, if you want to be "platform independent", then you are already possibly using GLUT/SDL or some other library and thoose have builtin platform independent keyboard management, if you don't have this and you are making a Win32 application, then you already have to include windows.h to get anything done so why not use it ?

    Or am I missing something here ?

    Mikael

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: How to map the key board without using windows.h

    Hi !

    I have never used GLUI, but if I remeber correct it is based on GLUT and in that can you should be able to use the keyboard callback function to snatch the keyboard keys, check the manual for GLUT for more info on the subject.

    Mikael

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: How to map the key board without using windows.h

    You can use: glutSpecialFunc(Special_keys);

    example usage:

    void Special_keys(unsigned char key, int x, int y)
    {
    switch (key) {
    case GLUT_KEY_DOWN:
    paddle_state = 2;
    paddle_direction = 1;
    break;
    case GLUT_KEY_UP:
    paddle_state = 2;
    paddle_direction = -1;
    break;
    case GLUT_KEY_RIGHT:
    paddle_state = 2;
    paddle_direction = -1;
    break;
    case GLUT_KEY_LEFT:
    paddle_state = 2;
    paddle_direction = -1;
    break;
    default:
    break;
    }

    }


    Originally posted by Amol Joshi:

    Hi Mikael,
    thanks for replying..

    Actually I an very new in OGL field..
    I developed an application using GLUi, which is having functions for zoom in/out and pan.
    I can use this with the help of mouse. But I want to control the same by using arrow keys and + - keys..
    now can u guide me which function may solve my purpose ??
    thanks once again

    Amol


Similar Threads

  1. On board GPUs
    By devdept in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 02-06-2009, 05:50 AM
  2. drawing a 3D board
    By beginner911 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-14-2004, 09:47 AM
  3. GEForce2 MX Board
    By castle in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-15-2001, 03:41 AM
  4. open gl with and on board video card in windows 2000
    By Happy_Hippie in forum OpenGL: User Software
    Replies: 3
    Last Post: 04-11-2001, 05:54 PM
  5. Is this a NVIDIA only board ?
    By paddy in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 12-06-2000, 12:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean