/***************************
** crackberg; Matus Telgarsky [ catachresis@cmu.edu ] 2005
** */
-#ifndef HAVE_COCOA
+#ifndef HAVE_JWXYZ
# define XK_MISCELLANY
# include <X11/keysymdef.h>
#endif
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel((flat) ? GL_FLAT : GL_SMOOTH);
+# ifndef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */
glPolygonMode(GL_FRONT_AND_BACK, (MI_IS_WIREFRAME(mi)) ? GL_LINE : GL_FILL);
+# endif
if (lit) {
glEnable(GL_LIGHTING);
if (ev->xany.type == KeyPress) {
switch (keysym) {
case XK_Left: cberg->motion_state |= MOTION_LROT; break;
+ case XK_Prior: cberg->motion_state |= MOTION_LROT; break;
case XK_Right: cberg->motion_state |= MOTION_RROT; break;
+ case XK_Next: cberg->motion_state |= MOTION_RROT; break;
case XK_Down: cberg->motion_state |= MOTION_BACK; break;
case XK_Up: cberg->motion_state |= MOTION_FORW; break;
case '1': cberg->motion_state |= MOTION_DEC; break;
switch (keysym) {
case XK_Left: cberg->motion_state &= ~MOTION_LROT; break;
+ case XK_Prior: cberg->motion_state &= ~MOTION_LROT; break;
case XK_Right: cberg->motion_state &= ~MOTION_RROT; break;
+ case XK_Next: cberg->motion_state &= ~MOTION_RROT; break;
case XK_Down: cberg->motion_state &= ~MOTION_BACK; break;
case XK_Up: cberg->motion_state &= ~MOTION_FORW; break;
case '1': cberg->motion_state &= ~MOTION_DEC; break;
if (dy > 0 && dy > dx) dx = 0;
if (dy < 0 && dy < dx) dx = 0;
+ {
+ int rot = current_device_rotation();
+ int swap;
+ while (rot <= -180) rot += 360;
+ while (rot > 180) rot -= 360;
+ if (rot > 135 || rot < -135) /* 180 */
+ dx = -dx, dy = -dy;
+ else if (rot > 45) /* 90 */
+ swap = dx, dx = -dy, dy = swap;
+ else if (rot < -45) /* 270 */
+ swap = dx, dx = dy, dy = -swap;
+ }
+
if (dx > 0) cberg->motion_state |= MOTION_LEFT;
else if (dx < 0) cberg->motion_state |= MOTION_RIGHT;
else if (dy > 0) cberg->motion_state |= MOTION_FORW;