[comp.sys.amiga] I was just wondering...

klm@munsell.UUCP (Kevin [Being Weird Isn't Enough] McBride) (11/19/87)

I was floundering around in the RKMs and Intuition the other day and
came up with a question.  I know how to specify shortcut keys (i.e.
Right Amiga - <key>) in your menu structures, and when you pull down that
menu it shows you a pretty little image of the amiga key to the right
of your menu text.

1)  Where does that image come from?  I don't see any pointers to an image
    structure floating around anywhere.

2)  Is it built in to Intuition?

3)  If the answer to 2) is YES, then how did Charlie Heath manage to
    change it in TxED?  (At least in my old version)

4)  How do you specify a non-<Right Amiga> Hot Key in your menu?  A couple
    of other programs I've seen use these.  They don't have an 'image' of
    the appropriate key, just plain text.  Is this done by kludging the
    text in your menu structure and then using RAWKEYS on the window to
    intercept everything?

While I'm at it, I've got another menu oriented question.  I have a piece of
commercial software that I want to 'enhance' by way of adding an unrelated
feature.  If I had the source code for this beast, I'd just rewrite it.  I
considered writing to the author and asking him to do it, but I see no hope
in that because what I want to do is really off the wall.  A bona-fide hack.

Using the program 'menutext' that came around here a while back (6 months?)
I intend to change the text of a menu item for a feature that I never use in
this program.  I then want to write a program that (kind of like MonIDCMP)
that will intercept all messages to the program's IDCMP port and, if the 
message is a menu select on 'my' menu item, will perform 'my' function.  All 
other messages will be passed on, unscathed, to the victim program.  Well, 
almost.  When I intercept a CLOSEWINDOW message, I'm going to set everything 
back to normal and de-allocate the UserData stuff, before I pass the message 
along and let the program go it's merry way.

Does this sound like a reasonable thing to do?  Is it possible to do this?
Remember this is just a hack, I'm not necessarily going to subject the
rest of the world to my depravity.  I mean, if I saw *real* commercial
possibilities for my, ahem, 'feature', I'd damn sure call up the guy who
wrote this program and try to talk him into it.  Right now, I'm just doing
it for kicks.  Sort of.

Thanks in advance for any info that will help me advance the cause of
bizarre hacks.

-- 
Kevin McBride, the guy in the brace //       | It's the end of the world
Eikonix - A Kodak Co.              //        |   as we know it,
Billerica, MA                  \\ //  Amiga  | 
{encore,adelie}!munsell!klm     \X/   Rules! | And I feel fine...

higgin@cbmvax.UUCP (11/19/87)

in article <1388@weber.munsell.UUCP>, klm@munsell.UUCP (Kevin [Being Weird Isn't Enough] McBride) says:
> Keywords: technical inquiry
> 4)  How do you specify a non-<Right Amiga> Hot Key in your menu?  A couple
>     of other programs I've seen use these.  They don't have an 'image' of
>     the appropriate key, just plain text.  Is this done by kludging the
>     text in your menu structure and then using RAWKEYS on the window to
>     intercept everything?

Yes, or VANILLAKEY.

> While I'm at it, I've got another menu oriented question.  I have a piece of
> commercial software that I want to 'enhance' by way of adding an unrelated
> feature.  If I had the source code for this beast, I'd just rewrite it.  I
> considered writing to the author and asking him to do it, but I see no hope
> in that because what I want to do is really off the wall.  A bona-fide hack.

Gulp.

> Using the program 'menutext' that came around here a while back (6 months?)
> I intend to change the text of a menu item for a feature that I never use in
> this program.  I then want to write a program that (kind of like MonIDCMP)
> that will intercept all messages to the program's IDCMP port and, if the 
> message is a menu select on 'my' menu item, will perform 'my' function.  All 
> other messages will be passed on, unscathed, to the victim program.  Well, 
> almost.  When I intercept a CLOSEWINDOW message, I'm going to set everything 
> back to normal and de-allocate the UserData stuff, before I pass the message 
> along and let the program go it's merry way.
> 
> Does this sound like a reasonable thing to do?  Is it possible to do this?
> Remember this is just a hack, I'm not necessarily going to subject the
> rest of the world to my depravity.  I mean, if I saw *real* commercial
> possibilities for my, ahem, 'feature', I'd damn sure call up the guy who
> wrote this program and try to talk him into it.  Right now, I'm just doing
> it for kicks.  Sort of.

Sounds possible, and if implemented cleanly, shouldn't affect the program
in question.  I hope your program will know how to disappear if he quits
the program through a menu action, i.e., you'll be checking for that one.

> Thanks in advance for any info that will help me advance the cause of
> bizarre hacks.
> Kevin McBride, the guy in the brace //       | It's the end of the world
> Eikonix - A Kodak Co.              //        |   as we know it,
> Billerica, MA                  \\ //  Amiga  | 
> {encore,adelie}!munsell!klm     \X/   Rules! | And I feel fine...

	Paul.

lee@uhccux.UUCP (11/23/87)

In article <1388@weber.munsell.UUCP> klm@munsell.UUCP (Kevin [Being Weird Isn't Enough] McBride) writes:
>...
>2)  Is it built in to Intuition?

Yes.
>
>3)  If the answer to 2) is YES, then how did Charlie Heath manage to
>    change it in TxED?  (At least in my old version)

In my version of TxEd, 1.4, it's not changed.  The hot key options are
specified in the menu structure just as the manual describes.
>
>4)  How do you specify a non-<Right Amiga> Hot Key in your menu?  A couple
>    of other programs I've seen use these.  They don't have an 'image' of
>    the appropriate key, just plain text.  Is this done by kludging the
>    text in your menu structure and then using RAWKEYS on the window to
>    intercept everything?

You can do it this way.
>...
>message is a menu select on 'my' menu item, will perform 'my' function.  All 
>...
>Does this sound like a reasonable thing to do?  Is it possible to do this?
>...
>wrote this program and try to talk him into it.  Right now, I'm just doing
>it for kicks.  Sort of.

If you want kicks, disassemble the program.  Then you can do what you propose,
or anything else.  Myself, I can hardly bear to have a binary without
source code, and disassembly is relaxing.  I've changed my version of
TxEd, for instance, to use the control key as an alternative to the
right Amiga key for fast menu selection, and to display alt characters
as ed does.

I have a disassembler, in case you need one.

>... 
>Kevin McBride, the guy in the brace //       | It's the end of the world

Greg Lee
U.S.mail: 562 Moore Hall, Dept. of Linguistics, Univ. of Hawaii, HONO, HI 96822
INTERNET: lee@uhccux.uhcc.hawaii.edu
UUCP:     {ihnp4,dcdwest,ucbvax}!sdcsvax!nosc!uhccux!lee
BITNET:   lee%uhccux.uhcc.hawaii.edu@rutgers.edu