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 CxFilter(), CxTranslate(), CxSender(), commodities.library/SetFilter(),
53 commodities.library/CxObjError()
59 26.04.98 SDuvan implemented
61 *****************************************************************************/
63 CxObj
*filter
; /* The objects making up the hotkey */
64 CxObj
*sender
; /* functionality... */
67 if((filter
= CxFilter(description
)) == NULL
)
70 if((sender
= CxSender(port
, id
)) == NULL
)
76 AttachCxObj(filter
, sender
);
78 /* Create the commodities equivalent of NIL: */
79 if((translator
= CxTranslate(NULL
)) == NULL
)
81 DeleteCxObjAll(filter
);
85 AttachCxObj(filter
, translator
);