Sponsored Content
Top Forums Programming X11 Button Event not Reported Post 302989556 by rlsj on Saturday 14th of January 2017 12:05:33 PM
Old 01-14-2017
X11 Button Event not Reported

I have a peculiar problem (aren't they all?). A new program that uses X11 fails to get any ButtonRelease event reported to it after the XNextEvent call. That is, mouse clicks don't work. The program gets others, such as exposure and keyboard events, but not button press or release. Other programs running on the same hardware obviously do get all mouse clicks. Compounding the problem, this failure occurs under Ubuntu and Mint, but all events are reported under Raspbian -- that is, under Raspbian the failure does not occur.

This is the setup instruction:
Code:
i = XSelectInput(dpy,win, ExposureMask | KeyPressMask |
        ButtonReleaseMask | KeyReleaseMask);

After issuance i contains 1.

I've read (seemingly relevant parts of) the X11 manual without gaining a clue. I'm hoping that someone else has experienced this problem and found the cause.

Would this question be more appropriate in another group? Which one?

--rLsj
Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, sample output, and code segments.

Last edited by Don Cragun; 01-14-2017 at 06:00 PM.. Reason: Add CODE and ICODE tags.
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Script for using the Back button and the Close button

Here's a question I have for anyone that might be able to help me: I can write a html script that will allow the user to return to the previous page using the back button, and I can write a script that will allow the user to return to the previous page using the close button, but...is there a... (1 Reply)
Discussion started by: mdgibson
1 Replies

2. UNIX for Dummies Questions & Answers

Changing middle mouse button for pasting to right mouse button in cygwin rxvt

Hi, I'm using rxvt in Cygwin and I'm wondering how to change my mouse bindings from the middle button for pasting to the right button. The main reason why I want to do this is because my laptop doesn't have a middle mouse button. Thanks for any help! (2 Replies)
Discussion started by: sayeo
2 Replies

3. Windows & DOS: Issues & Discussions

cygwin-x/can't install xorg-x11-f100 & xorg-x11-fnts

Hello All. Really a newbie to Linux/Unix. Trying to get into Linux. Using XP PE currently. Installed cygwin and trying to intall cygwin-x. Everything else is setup nice but i can't seem to install these two packages (without whom xwin won't start) 1. xorg-x11-f100 2. xorg-x11-fnts Tried the... (1 Reply)
Discussion started by: binodbdrchand
1 Replies

4. UNIX for Advanced & Expert Users

[Solved] putty+x11:How do I pass X11 display rights to "su"?

I can log into a unix system with Putty. I've set the "X11 forwarding" checkbox, and I've verified that I can display an X11 window back on my laptop. What I need to be able to do is "su" to another uid after logging in and then run something which display a window back on my laptop, with the... (2 Replies)
Discussion started by: dkarr
2 Replies

5. Post Here to Contact Site Administrators and Moderators

New Thread Button

Where do I find the New Thread Button so I can post a message to get some help in an issue I am having ? (2 Replies)
Discussion started by: kstalder
2 Replies
XSelectInput()															    XSelectInput()

Name
  XSelectInput - select the event types to be sent to a window.

Synopsis
  XSelectInput(display, w, event_mask)
	Display *display;
	Window w;
	long event_mask;

Arguments
  display   Specifies a connection to an X server; returned from XOpenDisplay().

  w	    Specifies the ID of the window interested in the events.

  event_mask
	    Specifies the event mask.  This mask is the bitwise OR of one or more of the valid event mask bits (see below).

Description
  XSelectInput()  defines  which  input  events  the  window is interested in.	If a window is not interested in a device event (button, key,
  motion, or border crossing), it propagates up to the closest ancestor unless otherwise specified in the do_not_propagate_mask attribute.

  The bits of the mask are defined in <X11/X.h> :

  ButtonPressMask	NoEventMask
  ButtonReleaseMask	KeyPressMask
  EnterWindowMask	KeyReleaseMask
  LeaveWindowMask	ExposureMask
  PointerMotionMask	VisibilityChangeMask
  PointerMotionHintMask StructureNotifyMask
  Button1MotionMask	ResizeRedirectMask
  Button2MotionMask	SubstructureNotifyMask
  Button3MotionMask	SubstructureRedirectMask
  Button4MotionMask	FocusChangeMask
  Button5MotionMask	PropertyChangeMask
  ButtonMotionMask	ColormapChangeMask
  KeymapStateMask	OwnerGrabButtonMask

  A call on XSelectInput() overrides any previous call on XSelectInput() for the same window from the same client but not for other  clients.
  Multiple  clients can select input on the same window; their event_mask window attributes are disjoint.  When an event is generated it will
  be reported to all interested clients.  However, only one client at a time can select for each of SubstructureRedirectMask, ResizeRedirect-
  Mask, and ButtonPress.

  If  a  window  has both ButtonPressMask and ButtonReleaseMask selected, then a ButtonPress event in that window will automatically grab the
  mouse until all buttons are released, with events sent to windows as described for XGrabPointer().  This ensures that a window will see the
  ButtonRelease event corresponding to the ButtonPress event, even though the mouse may have exited the window in the meantime.

  If  PointerMotionMask  is  selected,	events	will  be sent independent of the state of the mouse buttons.  If instead, one or more of But-
  ton1MotionMask, Button2MotionMask, Button3MotionMask, Button4MotionMask, or Button5MotionMask is selected, MotionNotify events will be gen-
  erated only when one or more of the specified buttons is depressed.

  XCreateWindow() and XChangeWindowAttributes() can also set the event_mask attribute.

  For more information, see Volume One, Chapter 8, Events.

Errors
  BadValue  Specified event mask invalid.

  BadWindow

See Also
  XQLength(),	XAllowEvents(),   XCheckIfEvent(),   XCheckMaskEvent(),  XCheckTypedEvent(),  XCheckTypedWindowEvent(),  XCheckWindowEvent(),
  XEventsQueued(), XGetInputFocus(), XGetMotionEvents(), XIfEvent(), XMaskEvent(), XNextEvent(),  XPeekEvent(),  XPeekIfEvent(),  XPending(),
  XPutBackEvent(), XSendEvent(), XSetInputFocus(), XSynchronize(), XWindowEvent().

Xlib - Input Handling														    XSelectInput()
All times are GMT -4. The time now is 05:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy