After registering a callback with glutMotionFunc() I noticed that special key modifiers as Shift, Control and so on aren't generated at all on X11.
Solution: I solved this problem with adding some code into fg_xinput_x11.c file, fgHandleExtensionEvents function, line 251.
I thing that manually generated MotionNotifyEvent isn't complete and so I added "std_ev.xmotion.state |= event->mods.base" line which solved my problem;
The wording on the original GLUT documentation is slightly vague, but I think the intention is for modifiers to be flagged only on Keyboard, KeyboardUp, Special, SpecialUp, and Mouse callbacks. Not motion callbacks.
I'll fire up my silicon graphics doorstop, to see what the original behaviour was.
This issue has come up before (I think, didn't feel like reading the
whole thread):
http://sourceforge.net/p/freeglut/mailman/message/20281575/
But previous people have agreed with you John, and with good reason:
On Wed, 2008-09-10 at 07:55 -0500, Steve Baker wrote:
John, I also came across this:
https://bugzilla.redhat.com/show_bug.cgi?id=971577
Not sure if it is still relevant (and in the end it didn't necessarily
seem to be a freeglut problem)
Note, however, that on windows you can call glutGetModifiers during a
motion or passivemotion callback and get what modifiers are down at
the time the callback was generated (line 1146 of fg_main_mswin.c).
That doesn't avoid the problem identified by Steve though, and perhaps
we should pull behavior in line between windows and X11... That means:
- in all cases update/improve the docs
- either remove this functionality from windows, or add it to X11.
- first would be a breaking change (docs should explain Steve's logic)
- second would allow users to shoot themselves in the foot a bit, if
they're not careful. Steve's logic also needs to be explained, but
with different emphasis.
I vote for adding to X11 (it doesn't break compatibility for programs
that don't expect this to be possible).
All the best,
Dee