From: root@drdhh.hanse.de (Bjoern Kriews)
Subject: Aktive Applikation per Cursortasten (Hack-Repost)
Summary: How to change active app via cursorkeys
Keywords: active app, cmd-curkeys, ps
Organization: Digital Island
Date: Thu, 3 Sep 1992 17:30:16 GMT

Hi !

Dieser Thread ist offenbar neulich in c.s.n. gelaufen.
Ich habe es micht mitbekommen und ich halte diesen Artikel
fuer so brauchbar (und so kurz), dass ich ihn hier nochmals
poste.

Das ganze ist ein Hack, um per Command-Alt up/down nicht nur
das Top-Window sondern auch die aktive App zu setzen. 
Fehlte mir schon lange.

Dank an Jason Breckenridge, der mir den Code zukommen liess.

So long, Bjoern

----

>From rft@hulme-pc-2e.Stanford.EDU Mon Aug 31 23:32:43 1992
Return-Path: <rft@hulme-pc-2e.Stanford.EDU>
Received: from hulme-pc-2e.Stanford.EDU by skatter.usask.ca (4.1/SMI-4.1)
	id AA00910; Mon, 31 Aug 92 23:32:28 CST
Received: by hulme-pc-2e.Stanford.EDU (NeXT-1.0 (From Sendmail 5.52)/inc-1.0)
	id AA03794; Mon, 31 Aug 92 22:32:06 PDT
Date: Mon, 31 Aug 92 22:32:06 PDT
From: rft@hulme-pc-2e.Stanford.EDU (Robert F Tobler)
Message-Id: <9209010532.AA03794@hulme-pc-2e.Stanford.EDU>
Received: by NeXT Mailer (1.63)
To: jake@skatter.usask.ca
Subject: WindowServerHack
Status: R

At the end of this message you will find a uuencoded version of my  
original post (I uuencoded it to ensure that no mailer would mangle  
the 80-character formatted ps code contained in this message).

Here is some additional information if you need to know more about  
the way this works.

Short description:

The blocks of three lines marked 'NEW' in handle commands check if  
the alternate key was depressed after /_handleCommand checked for up  
and down arrows and cycled the windows once.

/activateAppWithTopWindow  searches for the topmost appwindow in a  
loop, when its found it creates two mouse clicks in the title bar of  
this window (one mouse-down, one mouse-up).

Robert F. Tobler
(rft@cs.stanford.edu)

begin 640 WindowServerHack
M5&AA;FMS('1O($1A=FED($MO<VMI+"!W:&\@<V5N="!M92!H:7,@4&]I;G0M
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L;W<@97AC:"`P(&5X8V@*"0D)
M"2`@("!S>7-T96UD:6-T("]O<F1E<G=I;F1O=R!G970@97AE8PH)"0D)("`@
M(&5X:70*"0D)"7T@:68*"0D)("`@('T@:68)"0H)"0E](&EF"@D)("`@('T@
M9F]R86QL"@D)("`@(&-L96%R=&]M87)K"@D)("`@("]R971U<FY7:6YD;W=S
M('=I;F5X96,)"24@8V@*"0E]>PHE)24E)24E)24E)24E)24E)24E)24E)24E
M)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E
M)24E)24E)24*"D%&5$52(&AA8VL@*#$@861D:71I;VYA;"!P<F]C961U<F4@
M8V%L;&5D("=A8W1I=F%T94%P<%=I=&A4;W!7:6YD;W<G(&%N9"`V(&%D9&ET
M:6]N86P@;&EN97,@:6X@=&AE('!R;V-E8W5R92`G7VAA;F1L94-O;6UA;F0G
M(&UA<FME9"!B>2`E($Y%5RP@;W1H97)W:7-E(&YO(&-H86YG92P@97AC97!T
M(&EN9&5N=&%T:6]N*3H*)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E
M)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E)24E
M)24E"B]A8W1I=F%T94%P<%=I=&A4;W!7:6YD;W<@>PDE(&YO('!A<F%M971E
M<G,@86YD(')E='5R;B!V86QU97,*("`@('1R=64@,"`O9V5T5VEN9&]W<R!W
M:6YE>&5C"0DE(%=,4R!73`H@("`@9F%L<V4@97AC:"!["@ED=7`@8W5R<F5N
M='=I;F1O=VQE=F5L"0DE(%=,4R!F86QS92!W:6X@=VEN;&5V96P*"61U<"`O
M+VUA:6Y-96YU3&5V96P@9W0@97AC:`H)+R]D;V-K3&5V96P@;'0@;W(@>PD)
M)2!73%,@9F%L<V4@=VEN"@D@("`@9'5P(&-U<G)E;G1W:6YD;W=D:6-T"24@
M5TQ3(&9A;'-E('=I;B!D:6-T"@D@("`@9'5P(&YU;&P@;F4@>PH)"2]I8V]N
M(&=E="`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E)24E)24E)24E)24E)24*
`
end
-- 
bkr@drdhh.hanse.de - Bjoern Kriews - Stormsweg 6 - D-2000 Hamburg 76 - FRG
------------------------------------------------------------------------------
         "Ich trinke auch nicht weniger als andere Leute."  (K.H.)

Newsgroups: de.comp.sys.next