From owner-ntemacs-users@june  Thu Dec  5 09:10:24 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" " 5" "December" "1996" "11:19:14" "-0500" "Michael Welsh Duggan" "md5i@schenley.com" nil "42" "Re: Alt-TAB on ntemacs 19.34/Windows 95" "^From:" nil nil "12" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id JAA01981 for <voelker@june.cs.washington.edu>; Thu, 5 Dec 1996 09:10:23 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id JAA33169 for <voelker@joker.cs.washington.edu>; Thu, 5 Dec 1996 09:10:22 -0800
Received: from gate.usaor.net (gate.usaor.net [204.157.146.1]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with ESMTP id IAA28327 for <ntemacs-users@cs.washington.edu>; Thu, 5 Dec 1996 08:20:07 -0800
Received: from maru.schenley.com (maru.schenley.com [206.62.188.70]) by gate.usaor.net (8.7.3/8.7.5) with SMTP id LAA06627 for <ntemacs-users@cs.washington.edu>; Thu, 5 Dec 1996 11:29:12 -0500 (EST)
Received: by maru.schenley.com from localhost     (router,SLMAILNT V2.2); Thu, 05 Dec 1996 11:19:16 EST
Received: by maru.schenley.com from maru.schenley.com     (127.0.0.1::mail daemon; unverified,SLMAILNT V2.2); Thu, 05 Dec 1996 11:19:15 EST
References: <199612051201.MAA25654@propos.long.harlequin.co.uk>
In-Reply-To: Andrew Innes's message of Thu, 5 Dec 1996 12:01:38 GMT
Message-ID: <uybfdq7zx.fsf@maru.schenley.com>
Lines: 42
X-Mailer: Gnus v5.2.37/Emacs 19.32
From: "Michael Welsh Duggan" <md5i@schenley.com>
Sender: "Michael Welsh Duggan" <md5i@schenley.com>
To: ntemacs-users@cs.washington.edu
Subject: Re: Alt-TAB on ntemacs 19.34/Windows 95
Date: 05 Dec 1996 11:19:14 -0500

Andrew Innes <andrewi@harlequin.co.uk> writes:

> 
> On Thu, 5 Dec 1996 10:50:08 +0000, David Aspinall <dave@dcs.ed.ac.uk> said:
> >[Sorry in case of a repeat;  I think the previous copy of this got lost]
> >
> >This key raises a window-selection window, which although useful is not
> >what I hoped for.  Can we make this key be caught by Emacs so the 
> >usual completion functions, etc work?
> 
> I don't think so - Alt-TAB and various other keystrokes like it are
> intercepted by the system without ever reaching application programs.
> 
> Under Win95, DOS applications running in a DOS box can be allowed to see
> them, but (as I understand it) that works by using a low-level mechanism
> only applicable to DOS programs running under Win95.

I think there is a way to hack this, but I'm not absolutely sure it
would work...

You should be able to use RegisterHotKey() to declare the Alt-Tab
combination a hot key.  Then when the combination is pressed, a
WM_HOTKEY message is sent.  The problem is that this message is pushed
to the top of the event queue.  Because of this, I anticipate
key-ordering problems, even if we translate the command and repost it
as a char event.  However, someone more knowledgable about the Emacs
internals may know a way this can be hacked.

The keys that may need to be trapped this way are:

Alt+Esc
Alt+PrintScreen
Alt+Tab
Ctrl+Esc
PrintScreen
Shift+Alt+Tab

I am not sure at all about Ctrl+Alt+Del.  :-) 

-- 
Michael Duggan
(md5i@schenley.com)

From owner-ntemacs-users@june  Tue Dec  3 04:01:35 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" " 3" "December" "1996" "11:09:12" "+0000" "Pat Knight" "pat@ktgroup.co.uk" nil "15" "RE: Alt-TAB" "^From:" nil nil "12" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id EAA10870 for <voelker@june.cs.washington.edu>; Tue, 3 Dec 1996 04:01:35 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id EAA30731 for <voelker@joker.cs.washington.edu>; Tue, 3 Dec 1996 04:01:34 -0800
Received: from tcupboard.ktgroup.co.uk (www.ktgroup.co.uk [194.70.85.1]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with ESMTP id DAA09635 for <ntemacs-users@cs.washington.edu>; Tue, 3 Dec 1996 03:09:16 -0800
Received: from lurch.ktgroup.co.uk (lurch.ktgroup.co.uk [194.70.85.4]) by tcupboard.ktgroup.co.uk (8.7.6/8.7.3) with ESMTP id LAA00194; Tue, 3 Dec 1996 11:09:13 GMT
Received: from pcpat (pcpat.ktgroup.co.uk [194.70.85.30]) by lurch.ktgroup.co.uk (8.7.6/8.7.3) with SMTP id LAA19011; Tue, 3 Dec 1996 11:09:11 GMT
Message-Id: <1.5.4.32.19961203110912.0090e940@vcsmail>
X-Sender: pat@vcsmail
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Pat Knight <pat@ktgroup.co.uk>
To: Kevin Gallo <kgallo@microsoft.com>, David Aspinall <da@dcs.ed.ac.uk>,         ntemacs-users@cs.washington.edu
Subject: RE: Alt-TAB
Date: Tue, 03 Dec 1996 11:09:12 +0000

In a message sent at 18:13 02/12/96 -0800, Kevin Gallo wrote that:
>No - this is caught by the system and cannot be remapped in anyway (at 
>least there is no way I have ever seen to change it).  This is not even a 
>feature of the shell but part of the underlying OS.
>

I don't know if nt-emacs does this, but it is possible to write applications
which use ALT-TAB for their own purposes instead of the system default. The
application should look for the WM_SYSCHAR message for keystrokes as well as
the normal WM_CHAR. The WM_SYSCHAR gives you the messages generated by
ALT+key combination. It's then up to the application whether to carry out
the standard action or do it's own thing.

Cheers,
	Pat

From md5i@schenley.com  Mon May 12 06:18:12 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" "12" "May" "1997" "09:17:05" "-0400" "Michael Welsh Duggan" "md5i@schenley.com" nil "13" "Processing captured emacs keys" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from gate.usaor.net (gate.usaor.net [204.157.146.1]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id GAA20098 for <voelker@cs.washington.edu>; Mon, 12 May 1997 06:18:11 -0700
Received: from maru.schenley.com (maru.schenley.com [206.62.188.70]) 	by gate.usaor.net (8.8.5/8.8.5) with SMTP id JAA01971 	for <voelker@cs.washington.edu>; Mon, 12 May 1997 09:18:10 -0400 (EDT)
Received: by maru.schenley.com from localhost     (router,SLMAILNT V2.2); Mon, 12 May 1997 09:17:07 EDT
Received: by maru.schenley.com from maru.schenley.com     (127.0.0.1::mail daemon; unverified,SLMAILNT V2.2); Mon, 12 May 1997 09:17:07 EDT
References: <ug1vxa2jg.fsf_-_@maru.schenley.com>
In-Reply-To: "Michael Welsh Duggan"'s message of 08 May 1997 20:53:55 -0400
Message-ID: <usozsvnhq.fsf@maru.schenley.com>
Lines: 13
X-Mailer: Gnus v5.4.33/Emacs 19.34
From: "Michael Welsh Duggan" <md5i@schenley.com>
Sender: "Michael Welsh Duggan" <md5i@schenley.com>
To: voelker@cs.washington.edu (Geoff Voelker), andrewi@harlequin.co.uk
Cc: "Michael Welsh Duggan" <md5i@schenley.com>
Subject: Processing captured emacs keys
Date: 12 May 1997 09:17:05 -0400

I have a version of emacs sitting here on my desk which captures the
Alt-Tab key combination without the OS interfering.  Due to the way
this works (using RegisterHotKey), a function is more appropriate than
a variable for turning this processing on and off.  What should a
function like this look like?

Keep in mind that we can trap other key events usually usurped by the
OS, such as Ctrl-Esc, and Ctrl-Alt-Del.  So we may want a way to turn
these on or off individually.

-- 
Michael Duggan
(md5i@schenley.com)

From andrewi@harlequin.co.uk  Mon May 12 08:36:30 1997
X-VM-v5-Data: ([nil nil nil nil t nil nil nil nil]
	[nil "Mon" "12" "May" "1997" "16:35:35" "+0100" "Andrew Innes" "andrewi@harlequin.co.uk" "<199705121535.QAA17812@propos.long.harlequin.co.uk>" "26" "Re: Processing captured emacs keys" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from holly.cam.harlequin.co.uk (holly.cam.harlequin.co.uk [193.128.4.58]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id IAA26719 for <voelker@cs.washington.edu>; Mon, 12 May 1997 08:36:27 -0700
Received: from propos.long.harlequin.co.uk (propos.long.harlequin.co.uk [193.128.93.50]) by holly.cam.harlequin.co.uk (8.8.4/8.7.3) with ESMTP id QAA01515; Mon, 12 May 1997 16:36:08 +0100 (BST)
Received: from elan.long.harlequin.co.uk (elan.long.harlequin.co.uk [193.128.93.78]) by propos.long.harlequin.co.uk (8.8.4/8.6.12) with SMTP id QAA17812; Mon, 12 May 1997 16:35:35 +0100 (BST)
Message-Id: <199705121535.QAA17812@propos.long.harlequin.co.uk>
In-reply-to: <usozsvnhq.fsf@maru.schenley.com> (md5i@schenley.com)
From: Andrew Innes <andrewi@harlequin.co.uk>
To: md5i@schenley.com
CC: voelker@cs.washington.edu
Subject: Re: Processing captured emacs keys
Date: Mon, 12 May 1997 16:35:35 +0100 (BST)

On 12 May 1997 09:17:05 -0400, "Michael Welsh Duggan" <md5i@schenley.com> said:
>I have a version of emacs sitting here on my desk which captures the
>Alt-Tab key combination without the OS interfering.  Due to the way
>this works (using RegisterHotKey), a function is more appropriate than
>a variable for turning this processing on and off.  What should a
>function like this look like?
>
>Keep in mind that we can trap other key events usually usurped by the
>OS, such as Ctrl-Esc, and Ctrl-Alt-Del.  So we may want a way to turn
>these on or off individually.

Yes, I think individual control is necessary.

Well, Ctrl-Alt-Del can't be trapped at the application level, but for
the others you could presumably write a function analogous to
global-set-key that does the necessary work to register special
keychords as hot keys (called, say, `register-hot-key').  That is, it
would accept a keychord specified in any of the formats supported by
global-set-key, perhaps with an optional argument that if non-nil means
unregister the keychord.  It would do nothing if the keychord was not
special.

Binding the keychord should still be done by global-set-key or using
keymaps etc, as now.

AndrewI

From md5i@schenley.com  Fri May  9 10:06:58 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" " 9" "May" "1997" "13:05:48" "-0400" "Michael Welsh Duggan" "md5i@schenley.com" nil "21" "Alt-Tab processing" "^From:" nil nil "5" nil nil nil nil]
	nil)
Received: from gate.usaor.net (gate.usaor.net [204.157.146.1]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id KAA15273 for <voelker@cs.washington.edu>; Fri, 9 May 1997 10:06:57 -0700
Received: from maru.schenley.com (maru.schenley.com [206.62.188.70]) 	by gate.usaor.net (8.8.5/8.8.5) with SMTP id NAA05680 	for <voelker@cs.washington.edu>; Fri, 9 May 1997 13:06:53 -0400 (EDT)
Received: by maru.schenley.com from localhost     (router,SLMAILNT V2.2); Fri, 09 May 1997 13:05:50 EDT
Received: by maru.schenley.com from maru.schenley.com     (127.0.0.1::mail daemon; unverified,SLMAILNT V2.2); Fri, 09 May 1997 13:05:50 EDT
Message-ID: <urafginir.fsf@maru.schenley.com>
Lines: 21
From: "Michael Welsh Duggan" <md5i@schenley.com>
Sender: "Michael Welsh Duggan" <md5i@schenley.com>
To: voelker@cs.washington.edu, andrewi@harlequin.co.uk
Subject: Alt-Tab processing
Date: 09 May 1997 13:05:48 -0400

I am afraid that I have been having so much fun hacking Emacs this
past week or so, I am looking for excuses to continue doing so.  I am
considering tackling handling the following keys:

Alt+Esc
Alt+PrintScreen
Alt+Tab
Ctrl+Esc
PrintScreen
Shift+Alt+Tab
Ctrl+Alt+Del

How should I go about deciding which keys to trap?  We want something
similar to win32-pass-optional-keys-to-system and
win32-pass-alt-to-system, and we don't necessarily want this to be a
single switch on _all_ of the above combinations.  Suggestions?  Or
have one of you already handled this?

-- 
Michael Duggan
(md5i@schenley.com)

