🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #25157

Re: 'zap'; comp.window.x; BSD unix; keystrokes; event interrupts

#25157
From: edmoy
Date: Mon, 16 Feb 1987 20:11
34 lines
2404 bytes
In article <8702152056.AA17802@tcgould.tn.cornell.edu> garry@TCGOULD.TN.CORNELL.EDU (Garry Wiegand) writes:
>4) I'm running X on Ultrix/GPX's. It's V10; I can't tell which release. I'm
>   putting up graphics windows from a process, and I would like keystroke
>   events that occur in my windows to appear as keystrokes in the xterm
>   window that originally started the process. So I thought, "Ahah!, I'll just
>   use the xterm window as the *owner* of my graphics windows when I create
>   them." 
>
>   Unfortunately, when I do this (don't ask how I discover which is the
>   right xterm window :-), Bad Things happen. When I call XMapWindow on the 
>   new window: A) the xterm window shrinks to 1/4 its original size, and 
>   B) it starts flickering violently. 
>
>   Does anyone know how I can do what I want? For example, is there a way
>   to propagate events from one window to another? (I assume XPutBackEvent
>   is purely process-local, and wouldn't appreciate me munging the window
>   descriptor anyhow.) No, I don't want to Focus because my users will be 
>   totally mystified about what's going on...

The simpliest way I can think of is to get each keystroke and write it to the
controlling tty "/dev/tty" of the process, which should be the xterm window.

Otherwise, if you make xterm the parent window to your graphics window, you
need to do a XSelectInput() on most of the usual events and then ignore them.
If you don't, xterm will get those events and try to act on them, thinking
they are its events (e.g., XExposeEvents will cause xterm to resize itself!).

Edward Moy
Academic Computing Services
University of California
Berkeley, CA  94720

edmoy@opal.Berkeley.EDU
ucbvax!opal!edmoy
Technical Details
Message-ID: <2548@jade.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!mit-eddie!genrad!decvax!ucbvax!jade!opal.berkeley.edu!edmoy
References: <8702152056.AA17802@tcgould.tn.cornell.edu>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!mit-eddie!genrad!decvax!ucbvax!jade!opal.berkeley.edu!edmoy
From: edmoy@opal.berkeley.edu.UUCP
Newsgroups: comp.windows.x
Subject: Re: 'zap'; comp.window.x; BSD unix; keystrokes; event interrupts
Message-ID: <2548@jade.BERKELEY.EDU>
Date: Mon, 16-Feb-87 15:11:57 EST
Article-I.D.: jade.2548
Posted: Mon Feb 16 15:11:57 1987
Date-Received: Thu, 19-Feb-87 19:14:33 EST
References: <8702152056.AA17802@tcgould.tn.cornell.edu>
Sender: usenet@jade.BERKELEY.EDU
Reply-To: edmoy@opal.berkeley.edu ()
Organization: University of California, Berkeley
Lines: 34