mg@GODZILLA.CGL.RMIT.OZ.AU (Mike Gigante) (05/02/91)
References: <9104292244.AA26782@smaug.physics.mcgill.ca> <15418@life.ai.mit.edu> ringrose@fibula.ai.mit.edu (Robert Ringrose) writes: >How can I check for a combination of, say, shift and a mouse button? >(alt and/or control would be nice, too) >Checking for an individual mouse button is easy: getbutton(LEFTMOUSE) >Checking for a normal keyboard event is about as easy. Unfortunately, >shift, control, and alt aren't quite normal keyboard events. Ideas? > - Robert Ringrose > ringrose@ai.mit.edu Yes, I have the same request for a *general* solution. At the moment we often do something like the functions shiftedp, metap, ctrlp which in turn just do (or (getbutton LEFTSHIFTKEY) (getbutton(RIGHTSHIFTKEY)) etc I used to keep track of shifts/ctrl/alt via the event queue, but events were being lost and I changed from state variables (shifted?, etc) to polling directly. A general solution would be to extend the semantics of the devices to include ctrl bits, meta bits etc, also I'd like to see the ability to get back higher level events such as double click. At worst, I would like a time stamp with each event so that I can at least recognize things like double click without haveing to use horrid hacks with sginap() ok, it is a wish list, but the timestamp is something that shouldn't be too hard - make qread a VARARGS routine that will be backwards compatible but will allow pointers to 2 extra variables -- timestamp and 'bitfield' a suggestion: Device qread(short *qval, unsigned long *timecode, short *bitfield); I can do everything I want with this, and I then wont miond handling double clicks myself!! :-) Mike Gigante ACGC Royal Melbourne Institute of Technology