GLUTKEYBOARDFUNC(3)
π GLUTKEYBOARDFUNC(3) π
okay bestie, welcome to the OpenGLUT input corner of the manual β this one is literally the page that tells you how to make your window actually hear you when you smash a key. it's giving main character energy for real. and yes, the manual name is GLUTKEYBOARDFUNC and it lives in the OpenGLUT - input library, so you already know what time it is. π
β¨ LIBRARY β¨
OpenGLUT - input β that's the vibe check, bestie. input handling, no cap. π
π¦ SYNOPSIS π¦
#include <openglut.h>
void
glutKeyboardFunc(void( * callback )( unsigned char key, int x, int y ));
πΈ PARAMETERS πΈ
callbackβ your lil client function, the one that's gonna get called whenever a keyboard event happens. you write it, OpenGLUT runs it. that's the deal. π«Ά
β¨ DESCRIPTION β¨
okay so here's the tea: this callback registration is how you handle traditional ASCII keyboard input. the general rule of thumb (and it's a good one) is that if a key has a common ASCII code, then OpenGLUT assigns that code to the key and calls the Keyboard callback with the ASCII code in the key parameter. easy peasy. π
for other keys though? nope, you gotta use glutSpecialFunc(). and lowkey, not all keys can be reported by OpenGLUT at all. that's just the way it is, bestie. π
as a convenience (and it IS convenient, obsessed), the mouse coordinates β relative to your window β are also returned. so you get the key and the mouse position, together. iconic. πβ¨
and the big one: this callback is bound to the current window. periodt. π
π CAVEATS π
this function is not very international-friendly. like, it's not multilingual. it's monolingual and it's fine with that. π
windows created via glutCreateMenuWindow() always cascade keyboard and mouse events to their parent. always. no exceptions. so if your events are showing up somewhere you didn't expect, that's why, bestie. π
π SEE ALSO π
and that's the whole page, bestie!! go forth and register those callbacks. π¦π
source/version: OpenGLUT - input Β· date: UNDATED Β· footer vibe: UNTITLED() β yeah it's untitled and undated but it's still iconic, we don't judge. β¨π π
π¦ where this page comes from
- centos-stream 10: freeglut-devel 3.4.0-9.el10 Β· MIT
- centos-stream 9: freeglut-devel 3.2.1-10.el9 Β· MIT
- centos-stream 9: freeglut-devel 3.2.1-10.el9 Β· MIT
- fedora 43: freeglut-devel 3.6.0-6.fc43 Β· MIT
- fedora 43: freeglut-devel 3.6.0-6.fc43 Β· MIT
- fedora 43: freeglut-devel 3.8.0-1.fc43 Β· MIT
- fedora 43: freeglut-devel 3.8.0-1.fc43 Β· MIT
- fedora 44: freeglut-devel 3.8.0-2.fc44 Β· MIT
- fedora 44: freeglut-devel 3.8.0-2.fc44 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- opensuse-leap 16.0: freeglut-devel 3.2.2-160000.2.2 Β· MIT
- Copyright 2004, the OpenGLUT contributors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms