Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: how can I got the state about some key

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    Shanghai, China
    Posts
    2

    how can I got the state about some key

    I use glut

    fuction glutKeyboardFunc to register a
    call back funtion to get some key event.

    but this funtion seems can only the one char
    when some key is pressed

    and if I want to know some key is in KEY_DOWN state or KEY_UP state, what can I do?

    Thanks
    ==========
    yanxiaowen

  2. #2
    Intern Contributor
    Join Date
    Feb 2000
    Location
    Germany
    Posts
    95

    Re: how can I got the state about some key

    Use GetKeyboardState or GetKeyState functions.
    Or better, use DirectInput.
    Shouldn't be too hard to find some appropriate tutorials.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    Shanghai, China
    Posts
    2

    Re: how can I got the state about some key

    Originally posted by Inquisitor:
    Use GetKeyboardState or GetKeyState functions.
    Or better, use DirectInput.
    Shouldn't be too hard to find some appropriate tutorials.
    I have solved my problem like this:

    use glutKeyboardFunc to register the call back function to get some key down message

    use glutKeyboardUpFunc to register the call back function to get some key up message

    and glutKeyboardIngoreRepeat to ingore the auto repeat message when any key is held down

    and I will try the suggestion from you

    thank you very much
    ==========
    yanxiaowen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •