glutKeyboardFunc(3GLUT) GLUT glutKeyboardFunc(3GLUT)NAME
glutKeyboardFunc - sets the keyboard callback for the current window.
SYNTAX
#include <GLUT/glut.h>
void glutKeyboardFunc(void (*func)(unsigned char key,
int x, int y));
ARGUMENTS
func The new keyboard callback function.
DESCRIPTION
glutKeyboardFunc sets the keyboard callback for the current window. When a user types into the window, each key press generating an ASCII
character will generate a keyboard callback. The key callback parameter is the generated ASCII character. The state of modifier keys such
as Shift cannot be determined directly; their only effect will be on the returned ASCII data. The x and y callback parameters indicate the
mouse location in window relative coordinates when the key was pressed. When a new window is created, no keyboard callback is initially
registered, and ASCII key strokes in the window are ignored. Passing NULL to glutKeyboardFunc disables the generation of keyboard call-
backs.
During a keyboard callback, glutGetModifiers may be called to determine the state of modifier keys when the keystroke generating the call-
back occurred.
Use glutSpecialFunc for a means to detect non-ASCII key strokes.
SEE ALSO
glutKeyboardUpFunc, glutSpecialFunc, glutCreateWindow, glutMouseFunc, glutSpaceballButtonFunc, glutButtonBoxFunc, glutTabletButtonFunc,
glutGetModifiers
AUTHOR
Mark J. Kilgard (mjk@nvidia.com)
GLUT 3.7 glutKeyboardFunc(3GLUT)
Check Out this Related Man Page
glutKeyboardUpFunc(3GLUT) GLUT glutKeyboardUpFunc(3GLUT)NAME
glutKeyboardUpFunc - sets the keyboard up (key release) callback for the current window.
SYNTAX
void glutKeyboardUpFunc(void (*func)(unsigned char key,
int x, int y));
ARGUMENTS
func The new keyboard up callback function.
DESCRIPTION
glutKeyboardFunc sets the keyboard up (key release) callback for the current window. When a user types into the window, each key release
matching an ASCII character will generate a keyboard up callback. The key callback parameter is the generated ASCII character. The state of
modifier keys such as Shift cannot be determined directly; their only effect will be on the returned ASCII data. The x and y callback
parameters indicate the mouse location in window relative coordinates when the key was pressed. When a new window is created, no keyboard
callback is initially registered, and ASCII key strokes in the window are ignored. Passing NULL to glutKeyboardFunc disables the generation
of keyboard callbacks.
During a keyboard up callback, glutGetModifiers may be called to determine the state of modifier keys when the keystroke generating the
callback occurred.
To avoid the reporting of key release/press pairs due to auto repeat, use glutIgnoreKeyRepeat to ignore auto repeated keystrokes.
There is no guarantee that the keyboard press callback will match the exact ASCII character as the keyboard up callback. For example, the
key down may be for a lowercase b, but the key release may report an uppercase B if the shift state has changed. The same applies to sym-
bols and control characters. The precise behavior is window system dependent.
Use glutSpecialUpFunc for a means to detect non-ASCII key releases.
SEE ALSO
glutKeyboardFunc, glutSpecialUpFunc, glutSpecialFunc, glutCreateWindow, glutMouseFunc, glutSpaceballButtonFunc, glutButtonBoxFunc, glut-
TabletButtonFunc, glutGetModifiers, glutIgnoreKeyRepeat
AUTHOR
Mark J. Kilgard (mjk@nvidia.com)
GLUT 3.7 glutKeyboardUpFunc(3GLUT)
Hi,
I need to set Unix I/O terminal such as once key "," is pressed charcter "." is shown. Do you have any suggesion? The best to me is to accomplish this feauture with an environment variabile if it is possible.
Michele Ferrero (3 Replies)
I am writing a bash shell menu and would like to get a char immediately after a key is pressed. This script does not work but should give you an idea of what I am trying to do....
Thanks for the help
#! /bin/bash
ANSWER=""
echo -en "Choose item...\n"
until
do
$ANSWER = $STDIN
... (2 Replies)
Hello All,
I wounder if any one know if perl have the ability to run script in the background which record each keyboard keystorke?
If yes , how can I implement the part which reading the keyboard keystroke?
Is there any moudle that handle it ?
Thanks a head
Alalush (1 Reply)
How can the shortcut keys be defined that would open up a terminal window? When using a kvm switch, the mouse sometimes does not work, but the keyboard does, and by opening up a terminal window using a shortcut key combination, the mouse can be restarted by entering the predefined mouserestart... (0 Replies)
I'm trying to write a shell script that runs periodically and if I'm not at the keyboard, it should do one thing, but if I am at the keyboard, it should do another thing. Therefore I've decided that it would be good if I could press down the CTRL key, (or some other key) and have the shell script... (8 Replies)
Ubuntu 8 box was rebooted and now when I press 'm' on the keyboard it is not shown on my display. This happens in bash, when I run ksh everything is normal.
I am connected through SSH using SecureCRT, my bash is:
BASH_VERSION='3.2.39(1)-release'
I don't remember touching any of my... (3 Replies)
Putty: release 0.58
Operating system: Linux, release 2.6.36-rc7
Problem:
I use Putty to connet to server, initially everthing looks fine but after I browse some files, my keyboard acts funny, like if I keyin "cd", I got "je" on the screen. :wall:
This only happens on some existing files but... (4 Replies)