🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #24763

how to determine ID of keyboard focus window?

#24763
From: David Erb
Date: Sun, 10 Jan 1993 09:41
30 lines
1702 bytes
Specific:
How do I determine the window ID of the window which
has the input focus?  I will be sending synthetic KeyPress
events to this window, therefore I need the true ID, a number
like "0x0100064", not the enumerated constant InputFocus
which is a number like "1".  Sometimes GetInputFocus()
returns the former, sometimes the latter.  An
example of the latter is xman's Search subwindow
string input field.

Background:
I wrote a nifty program to take ASCII input from a serial
tty and send the characters to the X server as events. 
Since the input normally comes from a keyboard attached
to the serial tty, I would want the events to go to the
same place events from the console keyboard go to.  I
presume this would be the InputFocus, hence my use of
GetInputFocus().  Is there a better way to let the clients
know about the keys being typed on the serial keyboard?
They keyboard is one of those wierd ones for people with
hurt hands, so I want keystrokes to go to all clients,
not just one application.

If anyone wants the program, it works for some clients
(at least xterm, epoch and emacs) running with twm on
X11R5 PL 9 on Sun 4.1.1.  I'll be glad to distribute it.

Please answer by direct email, I will post a summary.
Thanks in advance, 
David Erb erb@fullfeed.com
Technical Details
Message-ID: <1993Jan10.094141.27640@fullfeed.fullfeed.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!gatech!rutgers!uwvax!gorgon!fullfeed!erb

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!gatech!rutgers!uwvax!gorgon!fullfeed!erb
From: erb@fullfeed.fullfeed.com (David Erb)
Newsgroups: comp.windows.x
Subject: how to determine ID of keyboard focus window?
Message-ID: <1993Jan10.094141.27640@fullfeed.fullfeed.com>
Date: 10 Jan 93 09:41:41 GMT
Organization: FullFeed - Public Access Usenet/E-mail (+1 608 246 2701 guest)
Lines: 30