linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-c-programming@vger.kernel.org
Subject: About combined console/X11 programs (was: question about gcc and keyboard hadling)
Date: Tue, 6 Aug 2002 20:08:52 +0200	[thread overview]
Message-ID: <20020806180852.GX758@lug-owl.de> (raw)
In-Reply-To: <15695.63457.98209.624871@cerise.nosuchdomain.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]

On Tue, 2002-08-06 17:22:57 +0100, Glynn Clements <glynn.clements@virgin.net>
wrote in message <15695.63457.98209.624871@cerise.nosuchdomain.co.uk>:
> 
> Jan-Benedict Glaw wrote:
> 
> > Even better question: I'd like to work on a text-based application and
> > I'd like to act on simply pressing eg. Ctrl (change some context menu).
> > I can do this with the hack I just posted nicely, but it will fail when
> > running under X11. Is there any possibility in getting a callback
> > registered called everytime an event occures which affects my terminal
> > emulation's window?
> 
> No, there isn't.
> 
> An application which uses terminal I/O is inherently limited by the
> set of actions for which the terminal actually generates input.

Think different. Think of linking mentioned application against
xlibs/gtk+/whatever. Then, if(getenv("DISPLAY")) you could init the X11
client side. This way, you can work on console (using so far Linux'isms)
_and_ you can work under X11 within _one_ binary. What now is the point
is to fetch all the events which are ment to out xterm's window.

So, if you're running on console (!getenv("DISPLAY")), you initialize
your input routine using ioctl(), but if running under X11, you
initialize needed xlibs. The remaining problems then is to fetch the
right events. I currently see no easy way in doing this, but there of
course must be some:-}

MfG, JBG

-- 
Jan-Benedict Glaw   .   jbglaw@lug-owl.de   .   +49-172-7608481
	 -- New APT-Proxy written in shell script --
	   http://lug-owl.de/~jbglaw/software/ap2/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2002-08-06 18:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-05  7:25 question about gcc and keyboard hadling +Rudymartin
2002-08-05 14:43 ` Glynn Clements
2002-08-06  6:13   ` Jan-Benedict Glaw
2002-08-06  6:19   ` Jan-Benedict Glaw
2002-08-06 16:22     ` Glynn Clements
2002-08-06 18:08       ` Jan-Benedict Glaw [this message]
2002-08-06 22:07         ` About combined console/X11 programs (was: question about gcc and keyboard hadling) Glynn Clements
2002-08-07  1:48           ` +Rudymartin
2002-08-07 12:00             ` Glynn Clements
2002-08-07 13:30               ` About combined console/X11 programs Jan-Benedict Glaw
2002-08-07 22:32                 ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020806180852.GX758@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).