home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 18991 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.5 KB

  1. Path: sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!sol.ctr.columbia.edu!spool.mu.edu!sdd.hp.com!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
  2. From: mgraham@teal.csn.org (Michael Graham)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Trouble detecting correct events with Button event masks
  5. Message-ID: <1992Dec30.211105.19397@sm.sony.co.jp>
  6. Date: 30 Dec 92 21:11:05 GMT
  7. Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
  8. Distribution: fj
  9. Organization: Colorado SuperNet, Inc.
  10. Lines: 24
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: Wed, 30 Dec 1992 17:25:53 GMT
  14. Message-Id: <C031r6.MGL@csn.org>
  15. Newsgroups: comp.windows.x,comp.windows.open-look
  16. Sender: xpert-request@expo.lcs.mit.edu
  17.  
  18. I am having a problem with event masks.  I'm developing on a Sun 
  19. with SunOS 4.1.2 and whatever OLIT version they ship with that -
  20. I think it's 3.0.  I'm trying to detect a motion event with Button1
  21. down ONLY!!  I'm using the event mask Button1MotionMask but it 
  22. triggers the event handler when ANY button is pressed (1, 2 or 3).  
  23. I have tried various combinations of the Button*Masks in X.h (like 
  24. Button1Mask, ButtonPressMask, Button5MotionMask, etc.)and they all 
  25. behave the same way, i.e., the event handler gets invoked.  How do 
  26. I determine which button is pressed?
  27.  
  28. Here's a code sample:
  29.  
  30.     XtAddEventHandler( text, Button1MotionMask, FALSE,
  31.                        (XtEventHandler)drag_event, NULL ) ;
  32.  
  33. drag_event() gets called regardless of which button is pressed.
  34.  
  35.  
  36. Thanks for your help.
  37.