Re: A83: Apps, adding to current menues


[Prev][Next][Index][Thread]

Re: A83: Apps, adding to current menues




See, the problem is that it's quite complicated to do that sort of thing.  I
don't have any really great code to copy and paste in here, but I'll try to
give you a start at least.

First of all, if you want to make your life much easier, use an
[on]+something hotkey combination.  This way TIOS will still read it as a
keypress and pass you the "something" during the $1B pass of the key hook.
You can then just check to see if the [on] key is currently pressed when you
receive the proper key and jump to your handler code if it is.  To check if
the [on] key is pressed, just look at bit 3 of port 4.  If the bit is a 0,
then the [on] key is currently being pressed.

Then you want to do something once you receive this keycode, and you picked
a hard one - start an application.  There might be a RunApplication entry
point laying around somewhere undocumented but if there is, I don't know
about it.  And running an application by just jumping to it's start address
could get a touch messy due to context and other issues.  So the best way
(though it's a very ugly hack) to run an app as far as I know is to make the
system pretend that you ran the app from the keyboard.

How do you do this?  Well, first you need to load the APPS menu.  That's not
so hard, just return the APPS key scan code from the $1B that you detected
(should be $27 I think).  However, you'll have to set some sort of indicator
to yourself, so that you know that you should continue loading the app.
System flags are dangerous to use, though I'm not real sure of anything
better.  Anyhow, in the next $1B pass through the key code, when you see
that the indicator was set, load the name of the application into the
progName memory address, and pass the enter key as being pressed.  It's a
pretty weird system, but the TIOS will run the app loaded in progName
whenever the enter key is pressed at the APPS menu (which is good luck since
it would have been a pain in the neck otherwise).

There's just one little detail left (which you're probably wondering about).
If this is the method I use to run MirageOS with key hooks, why don't you
see the APPS menu pop up?  Well, in version 1.1, if you don't have auto-sort
enabled, you do see the APPS menu pop up for just a second.  What I did was
turn of the LCD before I loaded the APPS menu, then turned it back on once
MirageOS starts.  That way the user can't see the APPS menu at all.
Unfortunately for me, I slightly botched the order of things up in 1.1 so
that if auto-sort is off, you see the APPS menu briefly.

Hope this helps at least a bit,
-Dan Englender

P.S. I figured all this out by trial and error.  Took a while...

----- Original Message -----
From: "Robby Proie" <playnogamz@nls.net>
To: <assembly-83@lists.ticalc.org>
Sent: Monday, November 27, 2000 8:38 PM
Subject: RE: A83: Apps, adding to current menues


>
> I'm not sure that I understand what you are saying.  Lets say that I
wanted
> to call a one page app called "THEAPP" when the user presses the shift key
> and than the clear key (If that is possible).  What would the exact code
be
> the set this up.  If that key-combo is not possible, than what about if
they
> help the ON key and then pressed enter (which is somewhat like mirage's
> ON+APPS key combo).  Thanks for your help so far.
>
> Robby
>
> P.S. How have you figured out all of this information?
>
> -----Original Message-----
> From: owner-assembly-83@lists.ticalc.org
> [mailto:owner-assembly-83@lists.ticalc.org]On Behalf Of Dan Englender
> Sent: Sunday, November 26, 2000 4:16 PM
> To: assembly-83@lists.ticalc.org
> Subject: Re: A83: Apps, adding to current menues
>
>
>
> Hmm...I guess it doesn't help you too much if you don't know how to
activate
> it, right?  To activate it, load the address of the hook into HL, then ROM
> page of the hook into A, and then B_CALL $4F7B.  This is equivalent to
> doing:
>     ld    hl,hookaddr
>     ld    ($9B88),hl
>     ld    a,hookpage            ; or 'in    a,(6)' if you're on the hook
> page
>     ld    ($9B8A),a
>     set    0,(iy+34)
>
> -Dan Englender
>
> ----- Original Message -----
> From: "Dan Englender" <dan@calc.org>
> To: <assembly-83@lists.ticalc.org>
> Sent: Sunday, November 26, 2000 4:11 PM
> Subject: Re: A83: Apps, adding to current menues
>
>
> >
> > This is answer to both this message and the one posted earlier by
"Direct
> > G".
> >
> > There are two key hooks.  The more interesting one is what is usually
> called
> > the GetKey hook.  It's called during the TIOS key handler.  It's called
> once
> > on entry to the key handler, then once with the scan code of the current
> key
> > being pressed.  You can tell whether it's the former or latter condition
> by
> > checking the A register.  A value of $1A is passed if it's the on-entry
> > call, or a value of $1B if it's a "key pressed" call.  If it was $1B,
then
> > the GetCSC scan code value will be in register B.
> >
> > In either case, returning the z flag set will abort the process, and nz
> will
> > continue.  If the entry value was $1A, you don't have to return anything
> > special, if it was $1B, then you have to return the GetCSC scan code
value
> > that you want the system to process in register A.  Make sure you don't
> just
> > ret after obtaining a $1B, or you're going to get a lot of 5's on your
> > screen.
> >
> > Hope this helps,
> > -Dan Englender
> >
> > ----- Original Message -----
> > From: "Robby Proie" <playnogamz@nls.net>
> > To: <assembly-83@lists.ticalc.org>
> > Sent: Friday, November 24, 2000 4:18 PM
> > Subject: RE: A83: Apps, adding to current menues
> >
> >
> > >
> > > Is there any information you could give me about key hooks as of now.
> > Even
> > > if it isn't fine tuned, I could sure use it.  Don't worry about any of
> the
> > > other hooks
> > >
> > > -----Original Message-----
> > > From: owner-assembly-83@lists.ticalc.org
> > > [mailto:owner-assembly-83@lists.ticalc.org]On Behalf Of Dan Englender
> > > Sent: Thursday, November 23, 2000 10:34 PM
> > > To: assembly-83@lists.ticalc.org
> > > Subject: Re: A83: Apps, adding to current menues
> > >
> > >
> > >
> > > You wouldn't.  There's no released information anywhere related to
them.
> > > I'll get around to typing up the notes about them scribbled through my
> > > various notebooks sometime, and then release the information.
> > >
> > > -Dan Englender
> > >
> > > ----- Original Message -----
> > > From: "Robby Proie" <playnogamz@nls.net>
> > > To: <assembly-83@lists.ticalc.org>
> > > Sent: Thursday, November 23, 2000 5:33 PM
> > > Subject: RE: A83: Apps, adding to current menues
> > >
> > >
> > > >
> > > > Where would I find information on key hooks and other types of
hooks?
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
>
>
>




Follow-Ups: References: