From owner-freebsd-hackers Sat Aug 9 11:52:29 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA07745 for hackers-outgoing; Sat, 9 Aug 1997 11:52:29 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id LAA07740 for ; Sat, 9 Aug 1997 11:52:26 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id UAA29151; Sat, 9 Aug 1997 20:52:15 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.8.5) id UAA12331; Sat, 9 Aug 1997 20:43:35 +0200 (MET DST) Message-ID: <19970809204334.WG16542@uriah.heep.sax.de> Date: Sat, 9 Aug 1997 20:43:34 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: hackers@FreeBSD.ORG Cc: root@goff.comtat.kazan.su (System Administrator) Subject: Re: How to get state of ctrl, alt, shift keys ? References: <199708081606.SAA02524@sos.freebsd.dk> X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: =?iso-8859-1?Q?=3C199708081606=2ESAA02524=40sos=2Efreebsd=2Edk=3E=3B_fro?= =?iso-8859-1?Q?m_S=F8ren_Schmidt_on_Aug_8=2C_1997_18=3A06=3A44_+0200?= Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Søren Schmidt wrote: > > Can anybody help me? I need for my programm to get stat of the keys > > ctl,alt,shift - well, You know for this combinations, like Ctrl+PgUP > > and so on. Question: How can I do this? You should not do this. Don't learn the bad things from other systems. > You can use the KDGKBSTATE ioctl to read the modifier keys, see This will be very hard to do on a serial terminal, in a telnet session, or inside an xterm. ;-) And that's exactly the reason why this kind of hacks is deprecated. It's probably very hard to guess a number, but i think more than 75 % of the machines where a regular user is sitting in front of the screen (i.e. not counting server machines where the console isn't used by anyone regularly) are probably using X11 these days. Maybe even more. > What do you want that for ?? If you need different value for ctrl/alt PgUP > then you could modify the keymap to return different values, that should > be alot easier... ...and more portable, too. You could perhaps even modify an xterm mapping for it if you are keen to do this. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)