
 How to get keyboard grabbing programs to work with Software Carousel (SC)
 =============================================================== ==========

This "user report" intends to give some very basic tips how to get keyboard
grabbing TSRs working in a SC session, in an environment which is known to
restict the use of those programs. This will be shown and described by
integrating TODDY into SC. The information provided should not only give
those specific tips for this "example environment" but also intends to give
some basic advice how to handle unusual solutions for common problems. If
only one reader of this text gets a new idea how to create his/her specific
program environment, it was worth the time to compose this little article.

But before we'll go into things, let me add some personal notes, which may
explain, why I tried so badly to get my favorite keyboard grabbing program
to work: I came to DOS very late in the eyes of other folks, but when
switching to that operating system (MS-DOS version 3.2 was introduced at
that time) I had some years of experience with Z80 based computers. To
modify the code for those systems and to make them do unbelievable things
was a relatively easy task, but this new operating system was quite unusual
for me. Nevertheless, over the time I became more and more comfortable with
DOS, but I still missed some of my "extensions". And then, I cannot remember
exactly when, I found an unbelieveably powerful utility named TODDY, which
lets me do all those tasks I wanted to do! From then on I had that good DOS
companion I searched for so long.

After some years with boring big computers I discovered and bought my little
HP and I was very impressed: There was no problem to run my favorite TSR
TODDY out of the box! But things changed to the worse, when I upgraded my
little Palmi to 5 meg and bought Software Carousel a couple of months ago.
Don't misunderstand me: SC was worth every penny I paid for it, BUT my TSR
TODDY refused to work. I wanted to use both programs at the same time,
definitely I didn't want to go without TODDY. So I began to badly search for
a solution for my new problem.

Now, about 6 months later. I found the way how to get both my favorite
programs reliably working together without interference and I'm going to
share my experience with all other HP users.

To make things more clear I think it's a good idea to introduce both
programs in more detail. Toddy is described by its producer Eric Tauck
(excerpt from its docs) as a terminate and stay resident (TSR) utility that
enhances the entry and editing of DOS commands, that saves commands for
later retrieval, and provides resident macros that work like simple batch
files. Only certain programs that use DOS for input, like COMMAND.COM or
DEBUG.COM, will be affected by Toddy. Toddy will work on any PC compatible
running DOS 2.0 or greater. Toddy may be used and distributed freely and is
availabe in release 6.12 (dated 09-06-94).

Software Carousel is commercial software and is described as a task
switching enhancement for PC systems that run the DOS operating system. It
provides an efficient method to run up to 12 different programs and to
instantly switch among them. It's available in a tailormade version for the
HP palmtops.

If you followed my writing until now, you reached the main point: The cause
for that BIG conflict between TODDY and SC is, that in standard
configuration both programs grab the keyboard, but SC seems to be stronger.
So, my intention was to give both programs different keys, because using the
same keys "cries for disaster". After closely looking at the keyboard I
found the only activating key that works for both. It's the Fn-key! SC as a
program especially designed for the HP knows that Fn-key, Toddy as an
universal DOS program doesn't "see" that non-standard-DOS key. Bingo.

To be accurate: There is at least one other but far less nice way. Stop SC
from using any hotkey to avoid conflicts and use Toddy's features to call SC
routines. But in my opinion this way is less elegant and so I concentrated on
keeping the Fn-key as hot key.

Ok, that's it folks, I can stop my explanation. You got the "so easy to guess"
solution how to get a keyboard grabbing program to work in a SC session, but
you still might not be able to "translate" the content of these two important
paragraphs into a running setup. So I'll proceed explaining using other words
and describing a running example.


 Toddy, SC and automatic Startup
 ===============================

The probably most important fact or restriction is, that SC has to be the
first keyboard grabbing program in memory and programs like Toddy can only
be run individually in any section. Before somebody asks, yes, there is a
small utility file delivered with SC called SCKEYFIX which should allow
keyboard grabbing programs to be loaded _before_ SC, but I was not able to
find any program that worked that way (in case of Toddy my macros and
keyboard remapping got lost...). So I learned that this other way round
doesn't work reliably, because SC successfully tries to "hide" all programs
loaded before itself. And learning this lession led to the customized setup
I'm going to explain now.

Some words of caution: Before trying to modify your system setup, you should
meet the following requirements. You have a recent backup of your system,
Software Carousel is already installed and up and running. You know that
playing with software may influence the "runability" of your system and you
know that you have done all on your own will and nobody except you is liable
for the disaster you have produced...

Start SCCONFIG in the directory SC, pick up the third topic (Keyboard Control
and Hotkey Assignment) and change the hotkey to Fn-key. And remember, no other
will work reliably with programs like Toddy...

Now, lets go to the Work Area Characteristics in the main screen of SCCONFIG.
In case of my setup the first area looks like
   ___________________________________________
  |                                           |
  |  Work Area Name :  [ SysMan I ]           |
  |  Work Area Size :  555 k                  |
  |  Work Area Key  :  F1                     |
  |                                           |
  |  Work Area Startup Command List: SC 1     |
  |___________________________________________|

The second and the third area look quite similar, except of work area names,
keys and startup command list. Let's have a closer look into that SC.BAT, which
lets me easily manipulate the startup of SC. Following I divided this file in
sections, putting them together again in the file SC.BAT creates a running copy
(To function properly this file has to be placed everywhere in your DOS path)

  @echo off
  if "%1"=="+" goto INSTALL
  if "%1"=="-" goto REMOVE
  if "%1"=="1" goto SC1
  if "%1"=="2" goto SC2
  if "%1"=="3" goto SC3
  echo  ..... Missing or Wrong Parameter, No Action Done, Retry .....
  goto END

Comment: Using different parameters lets you start different parts of that
batch file to perform different tasks as follows. In my opinion it makes
more sense to have such an easy to edit startup batch which includes all the
different startup setups in one file (e.g. minimalized waste of space on your
drive)

Using a "+" as parameter behind the command SC branches to INSTALL. As you
know Toddy is always installed on my system and has to be removed before
starting SC (the output of TODDY is sent to the NUL device, which means,
avoiding a screen message). After switching to the SC directory on drive C:
Software Carousel will be started and the batch file will be terminated.
Note: Normally you may skip the line "goto end" because as long as SC is
running it will never come back to that batch file, but e.g. in case of a
disaster in directory SC the line "carousel" in the batch will be ignored
and then you may need that "goto end" to correctly terminate the batch.

  :INSTALL
  toddy /u >nul
  c:
  cd \sc
  carousel
  goto END

In some cases (I'm going to explain this sometimes in the future) it's
necessary to remove SC. This is done calling SC.BAT with parameter "-"

  :REMOVE
  c:\sc\quitsc
  goto END

Next we'll see some possibilities to startup files in SC sessions, which, in
case of my setup, is done automatically after every start of SC. This
feature has to be activated in SCCONFIG in menu Startup Controls for
Software Carousel. My setup looks as follows:
   ____________________________________________________________
  |                                                            |
  |  Pause to review Storage Pool before Startup :        No   |
  |  Automatically Start some Work Areas with Carousel :  Yes  |
  |  Time to allow for Work Area Program loading :  2 seconds  |
  |  Work Area Auto-Start Sequence :   3,2,1                   |
  |____________________________________________________________|
   
In consequence when starting Software Carousel with command SC +  all three
work areas will automatically call my startup batch SC.BAT with the correct
parameter (which was set in the startup command lines of each work area, see
above, you remember e.g. SC 1). In case of the third SC area this is quite
simple: The DOS prompt is altered to show the session name (in one line) and
Toddy will be launched within the standard 2 seconds loading time before
Software Carousel switches to area 2:

  :SC3
  prompt [Session3] $P$G
  toddy
  goto end

Work area 2 startup is a little bit more complicated. In this area I'm
going to fire up my dictionary. As you may remember the default starting
time to load programs in any workarea was preset to 2 seconds.
Unfortunately this is not enough for this session. Thanks to Sunshine,
they provide a program called WAITSC which enables you to customize the
startup time for each session (WAITSC is part of the SC package and can be
found in subdirectory \ETC on the SC disk). So the first command alters
this preset delay time to 7 seconds. The second line changes the DOS
prompt to PCWB (to make me remember this session is for my dictionary),
and the third line starts Toddy. Depending on which PC card is inserted
the dictionary is started from a: or from f: drive.

Note: Sure, I tried using variables to change the drive names. Unfortunately
variables slightly "confuse" SC and the automatic startup refused to work
reliably.

  :SC2
  waitsc 7
  prompt [PCWB] $P$G
  toddy
  if exist a:\lxmdrv.sys goto EXP
  a:
  goto CONT
  :EXP
  f:
  :CONT
  cd \pcwb
  pcwb
  goto END

And now the highlight: Session 1. Most is as described with the other two
sessions. But in this session I wanted to make my favorite offline reader to be
automatically started. Here I use another very handy utililty called
KEYSTUFF. As you can see the little utility kicks in the keys "100" (starting
AppMan), presses <ENTER> and after that <ALT><MORE> to start acCIS (which in my
setup is assigned to that "hot keys").

  :SC1
  prompt [SysMgr] $P$G
  toddy
  ks 100/\a\)
  goto END

OK, I'll stop now. I'm quite sure there are some people out there who say
"Nonsense" or "He only costs me time" or "Oh yes, I knew that for a long time".
No comment to those people, because obviously nobody told me that before.
Nevertheless I'd like to discuss with people who think that it's worth thinking
different and trying to do the "impossible". I'll come to the

  :END


PS: Tips, thoghts, additions, questions and even criticism are welcome
    Gottfried Burckhardt 101525.3644@compuserve.com  02.Jan.1997
    And a big thank you to Fred Kaufman, who did sensible proofreading

