[comp.sys.amiga] right mouse button

woods@parcvax.Xerox.COM (Donald R. Woods) (01/20/87)

In response to a recent query, several people have suggested using the IDCMP
flag RMBTRAP to get Intuition to send messages for the right mouse button.
(Normally it just brings up the menu and never tells the program about the
button.)  I looked in the IDCMP section of my Intuition manual but didn't see
this flag mentioned; was it new in 1.2, or is it just hidden in some obscure
part of the manual?

Meanwhile, I have a related problem.  I want to use the ALT and AMIGA keys as
part of multi-key combinations; that is, holding down those keys while typing
other keys has various effects.  Using RAWKEY works just fine, except for a
few special cases where Intuition intercepts the key combination and refuses
to tell my program about it.  One such combination is RIGHT-ALT plus
RIGHT-AMIGA, which Intuition treats the same as the right mouse button;
presumably RMBTRAP will let me see these keys.  Other combinations that
Intuition hides from me are AMIGA plus an arrow key (moves the mouse cursor)
and LEFT-AMIGA plus M or N.

Is there some way I can tell Intuition to stop meddling with the ALT and AMIGA
keys entirely, so that my program can see all the different keyboard
combinations I might choose to type?
-- 
--	-- Don Woods.			[*** Generic Disclaimer ***]
--		    ...!decwrl!parcvax!woods -or- Woods.pa@Xerox.com

ee173way@sdcc3.ucsd.EDU (John Schultz) (01/21/87)

  If you want everything, you'll have to do everything.  Look on
page 3-108 (Input Device) of the RKM.  This example shows you how to
hook into the input stream AHEAD of pesky Intuition.  You'll get
everything- less what Intuition itself creates.
  I haven't tried it, so I do not know if the code listed there is
bug free--> perhaps someone else around here has...

  John
  7OHN

carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner) (01/22/87)

In article <153@parcvax.Xerox.COM> woods@parcvax.xerox.com.UUCP (Donald R. Woods) writes:
>...
>Meanwhile, I have a related problem.  I want to use the ALT and AMIGA keys as
>part of multi-key combinations; that is, holding down those keys while typing
>other keys has various effects.  Using RAWKEY works just fine, except for a
>few special cases where Intuition intercepts the key combination and refuses
>to tell my program about it.  One such combination is RIGHT-ALT plus
>RIGHT-AMIGA, which Intuition treats the same as the right mouse button;
>presumably RMBTRAP will let me see these keys.  Other combinations that
>Intuition hides from me are AMIGA plus an arrow key (moves the mouse cursor)
>and LEFT-AMIGA plus M or N.
>
>Is there some way I can tell Intuition to stop meddling with the ALT and AMIGA
>keys entirely, so that my program can see all the different keyboard
>combinations I might choose to type?

   First a couple of warnings:

1. I don't know what kind of a program you are writing, but if you
   use the ALT keys for your own purposes your software may be
   crippled in foreign countries where certain ALT combinations
   are dead-key escapes for adding accents to charcters.

2. By using RAWKEY rather than the console.device, you are depriving
   your software of automatic foreign keymap translation.  You
   can do the translation yourself if you wish.  See example in
   the 1.2 Enhancer pack manual.

3. If you want to know about the key combos that Intuition strips
   out, you will have to write an input handler and put yourself
   in the chain before Intuition's handler.  Then you would see
   them before Intuition and you could signal your task that
   specific combinations have come along.  I did something similar
   in a hotkey program.  My handler and my main task shared
   a data area containing an array of flags.  If a defined hotkey
   was pressed, my handler set the flag for that key and Signal'd
   my main task.  A better way would have been to set up two
   MsgPorts and send messages to my main task but I was trying
   to keep the handler very small and simple.

   Be warned that if you do this, you will have two choices.
   When your handler sees one of the Intuition key combos,
   it can either pass them along to the next handler OR
   remove/null the input event.  If you DON'T remove/null them,
   then Intuition is STILL going to interpret the key combo
   and do whatever it normally does for that combo.
   If you DO remove/null the events, then you will be disabling
   a system feature for Everybody and this is NOT considered
   a nice thing to do in a multi-tasking environment.

   
   My suggestion is that you try to get by with Right Amiga + letter
key combinations for keyboard shortcuts.  See Intuition manual
"Style" chapter.

carolyn
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Carolyn Scheppner -- CBM   >>Amiga Technical Support<<
                     UUCP  ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn 
                     PHONE 215-431-9180
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=