GLUTSPACEBALLBUTTONFUNC(3)

πŸ“¦
version 3.8.0 Β· 2 versions
, in centos-stream 10, centos-stream 9, fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– glutSpaceballButtonFunc β€” the spaceball button callback page πŸ’–

ok so this is glutSpaceballButtonFunc(3), bestie. it lives in the OpenGLUT manual, in the input section. yes we are doing input today. buckle up. πŸŽ€


✨ LIBRARY ✨

OpenGLUT β€” input πŸ¦‹


✨ SYNOPSIS ✨

#include <openglut.h>

void
glutSpaceballButtonFunc(void( *callback )( int button, int state ));

✨ PARAMETERS ✨

  • callback β€” your client spaceball button hook. that's the lil function that gets pinged when a spaceball button does a thing. πŸ’…

✨ DESCRIPTION ✨

okay so real talk: this function registers a callback so a spaceball can report its buttons. if you've never met a spaceball, she's iconic β€” she has six axes of freedom (three of motion and three of orientation), plus buttons. main character energy fr fr. πŸ‘‘

the spaceball has glutDeviceGet(GLUT_NUM_SPACEBALL_BUTTONS) and numbers them from 1. so button one is the first button, not the zeroth button, we are NOT doing zero-indexing in this house (well. except for the mouse. more on that in a sec. 😭).

button state is either GLUT_UP or GLUT_DOWN. that's it. that's the whole vibe check. 🌈

the callback is bound to the current window. so like, wherever you are when you register it? that's her home. 🏠✨


✨ CAVEATS ✨

⚠️ bestie. listen. OpenGLUT does not implement spaceball support. 😭 the whole thing is a no-op. she's on the roster but she does not play. registered, sure, but never called. i know. i'm sorry.

and one more wrinkle for the road: mouse buttons are numbered from 0 in the GLUT API. so spaceball buttons start at 1, mouse buttons start at 0. inconsistent? yes. is it a wrinkle? the original literally calls it a wrinkle, so. it's a wrinkle. 🫠


✨ SEE ALSO ✨


and that's the whole page, bestie!! mwah 🫢

this one's dated UNDATED and it comes from UNTITLED() β€” a true mystery icon, no date, no title, just vibes ✨🌸 go forth and call your callbacks, even the ones that never fire πŸ’–