Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!uflorida!gatech!ncar!thor.atd.ucar.edu!thor From: thor@thor.atd.ucar.edu (Richard Neitzel) Newsgroups: comp.windows.x Subject: Help need for XSendEvent Message-ID: <10961@ncar.ucar.edu> Date: 8 Apr 91 20:56:41 GMT Sender: news@ncar.ucar.edu Organization: National Center for Atmospheric Research, Remote Sensing Facility Lines: 43 I am trying to write an application that needs to send text strings to an xterm. The most obvious method to me is to use selections and mimic the button2 actions by sending events to the target xterm. However, the xterm does not respond by getting the selection. I've tested the events sent with xev, so I am certain that xterm is getting them - so why isn't it getting the selection. Here's the effected part of the code: XEvent ev; ev.type = ButtonPress; ev.xbutton.type = ButtonPress; ev.xbutton.display = disp; ev.xbutton.window = wdw; ev.xbutton.root = root; ev.xbutton.subwindow = 0; ev.xbutton.time = CurrentTime; ev.xbutton.x = 10; ev.xbutton.y = 50; ev.xbutton.x_root = rx; ev.xbutton.y_root = ry; ev.xbutton.state = 0; ev.xbutton.button = Button2; ev.xbutton.same_screen = True; if (!XSendEvent(disp,wdw,True,ButtonPressMask,&ev)) cerr << "XSendEvent failed.\n"; ev.type = ButtonRelease; ev.xbutton.type = ButtonRelease; ev.xbutton.time = CurrentTime; ev.xbutton.state = Button2Mask; if (!XSendEvent(disp,wdw,True,ButtonReleaseMask,&ev)) cerr << "XSendEvent failed.\n"; -- Richard Neitzel thor@thor.atd.ucar.edu Torren med sitt skjegg National Center For Atmospheric Research lokkar borni under sole-vegg Box 3000 Boulder, CO 80307-3000 Gjo'i med sitt shinn 303-497-2057 jagar borni inn.