hello all. i want write commodie tool with key handler. i need handle some keys (not one, maybe 5-10). So, as i know, for software key handler aos have IDCMP flags for it: RAWKEY and VANILLAKEY. but IDCMP flags for active window only. I need anytime handler.
In rkrm3 i found some commoditie examples without IDCMP flags, with ArgString() func from amiga.lib. It's work anytime, not need window, only broker, but it trick only for one key. I try seatch on aminet, and in all case see only key handlers for active window, or only one key handler for argstring(). I need some like this:
#define some keys, 1,2,3 for example. //??
CxBase=OpenLibrary("commodities.library",37L);
broker = CxBroker(&newbroker, NULL);
ActivateCxObj(broker, 1L);
// ??
processmesg(); //??
DeleteCxObj(broker); // remove commoditie
CloseLibrary(CxBase); // close lib
/////////////////////////////////////
processmesg()
{
switch(....)
{
case Key_1:
printf("pressed key_1\n");
break;
case Key_2:
printf("pressed key_2\n");
break;
case Key_3:
printf("pressed key_3\n");
break;
}
};
So, i need little sample for anytime commoditie key handler.
thanx all for advance.