[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

536.0. "Desk ACCs and evnt_multi" by CADSYS::DALTON () Mon Jul 17 1989 17:32

    
    I've been experimenting around trying to develop a desk accessory that
    can be activated by a 'hot key'... In order to do this I thought I
    could have evnt_multi() wait for keyboard messages and then when the
    right key was pressed, the accessory could activate itself.
    
    Unfortunately it appears that as a DA the program does not get notified by
    evnt_multi when a keyboard event occurs... When linked and run as a
    regular program it receives the messages properly. Has anyone seen this
    before? Is there a work around? The DA reacts to timer and message events
    properly it just doesn't seem to get anything from the keyboard.  
    
    Kent
T.RTitleUserPersonal
Name
DateLines
536.1PRNSYS::LOMICKAJJeff LomickaMon Jul 17 1989 19:1717
This is normal - and is a feature - just like the workstation on your
desk, applications only receive keyboard input when their window is on
top.  (On the atari, "on top" is coupled to input focus.)  You will get
keyboard input only when a window you created from the accessory is the
top window on the desktop.

To implement "hot key", you will have to do something more intrusive. 
Several possibilities come to mind:

1. Using the timer feature of event_multi, poll the SHIFT and ALT keys
for a specific combination.  You can check the shift key state with one
of the bios/xbios routines. (don't use the other event wait routines
from .ACC's, only event_multi is known to work correctly.)

2. Steal the keyboard interrput vector and set a flag when you see the
keystroke you want.  Pick up the flag when the timer expires.