static struct ctx_info ctx_info;
static int cur_cursor = GLUT_CURSOR_INHERIT;
+static int ignore_key_repeat;
static glut_cb cb_display;
static glut_cb cb_idle;
upd_pending = 1;
}
+void glutIgnoreKeyRepeat(int ignore)
+{
+ ignore_key_repeat = ignore;
+}
+
#define UPD_EVMASK(x) \
do { \
if(func) { \
break;
case KeyPress:
+ if(0) {
case KeyRelease:
+ if(ignore_key_repeat && XEventsQueued(dpy, QueuedAfterReading)) {
+ XEvent next;
+ XPeekEvent(dpy, &next);
+
+ if(next.type == KeyPress && next.xkey.keycode == ev->xkey.keycode &&
+ next.xkey.time == ev->xkey.time) {
+ /* this is a key-repeat event, ignore the release and consume
+ * the following press
+ */
+ XNextEvent(dpy, &next);
+ break;
+ }
+ }
+ }
modstate = ev->xkey.state & (ShiftMask | ControlMask | Mod1Mask);
if(!(sym = XLookupKeysym(&ev->xkey, 0))) {
break;
cur_cursor = cidx;
}
+void glutSetKeyRepeat(int repmode)
+{
+ if(repmode) {
+ XAutoRepeatOn(dpy);
+ } else {
+ XAutoRepeatOff(dpy);
+ }
+}
+
static XVisualInfo *choose_visual(unsigned int mode)
{
XVisualInfo *vi;
}
}
+void glutSetKeyRepeat(int repmode)
+{
+}
+
#define WGL_DRAW_TO_WINDOW 0x2001
#define WGL_SUPPORT_OPENGL 0x2010
#define WGL_DOUBLE_BUFFER 0x2011
#define GLUT_ACTIVE_CTRL 4
#define GLUT_ACTIVE_ALT 8
+enum {
+ GLUT_KEY_REPEAT_OFF,
+ GLUT_KEY_REPEAT_ON
+};
+#define GLUT_KEY_REPEAT_DEFAULT GLUT_KEY_REPEAT_ON
+
typedef void (*glut_cb)(void);
typedef void (*glut_cb_reshape)(int x, int y);
typedef void (*glut_cb_state)(int state);
void glutSetIconTitle(const char *title);
void glutSetCursor(int cursor);
+void glutIgnoreKeyRepeat(int ignore);
+void glutSetKeyRepeat(int repmode);
+
void glutIdleFunc(glut_cb func);
void glutDisplayFunc(glut_cb func);
void glutReshapeFunc(glut_cb_reshape func);