2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 /*****************************************************************************
10 #include <proto/exec.h>
11 #include <proto/commodities.h>
12 #include <libraries/commodities.h>
14 extern struct Library
*CxBase
;
25 A simple way to get a hotkey for your program. The program is
26 posted a message when the user does the specified input action in
27 'description' regardless of whether the program has input focus or
28 not. The key combination event is swallowed, that is not sent any
29 farther in the input system.
31 It's recommended that the user should be able to specify a
32 program's hotkey with tooltypes, for instance
33 HOTKEY="alt shift f5".
36 description -- commodities filter description (see
37 commodities.library/SetFilter())
38 port -- message port the hotkey messages will be sent to
39 id -- identifier (see CxSender())
42 A pointer to a filter object which represents the HotKey.
45 Commodities.library must be open at the time of the call.
52 commodities.library/CxFilter(), commodities.library/CxTranslate(),
53 commodities.library/CxSender(), commodities.library/SetFilter(),
54 commodities.library/CxObjError()
60 26.04.98 SDuvan implemented
62 *****************************************************************************/
64 CxObj
*filter
; /* The objects making up the hotkey */
65 CxObj
*sender
; /* functionality... */
68 if((filter
= CxFilter(description
)) == NULL
)
71 if((sender
= CxSender(port
, id
)) == NULL
)
77 AttachCxObj(filter
, sender
);
79 /* Create the commodities equivalent of NIL: */
80 if((translator
= CxTranslate(NULL
)) == NULL
)
82 DeleteCxObjAll(filter
);
86 AttachCxObj(filter
, translator
);