a good place to hide an example 
thx so far
i cant get it running
, so…
if i understand the at command manual (page 155) correctly i should get responses on the hyperterminal after ive sended the “at+cmer=,1” command (which gives me an “ok”), but i get no responses at all no matter how often or long i press the buttons…
if im just misunderstang it, this is my sourcecode
basicly ive taken the example and put a key_subscribe call into a main function (and every function creates an output when its called… but no function gets called after the key_subscribe at all
/* Keyboard Handler */
key_Handler_f key_Handler;
/* First Subscription flag */
bool bOnce = TRUE;
/* Timer for key repetition */
adl_tmr_t * tRepeat;
/* Constants */
#define KEY_NONE 0xFF
/* Timer delays */
u32 key_RepeatTickTime; // Timer before each repeat
u32 key_RepeatTickDelay; // Delay before repeat
/* Prototypes */
bool key_UnsoHandler ( adl_atUnsolicited_t * Param );
void key_TimerHandler ( u8 Id, void * Context );
/* Keyboard Timer Handler */
void key_TimerHandler ( u8 Id, void * Context )
{
adl_atSendResponse(ADL_AT_UNS, "key_TimerHandler\n");
/* ReStart the Key timer, faster */
tRepeat = adl_tmrSubscribe ( FALSE, key_RepeatTickTime, ADL_TMR_TYPE_TICK, key_TimerHandler );
/* Call Unsolicited handler */
key_UnsoHandler ( ( adl_atUnsolicited_t * ) NULL );
}
/* Keyboard unsolicited handler */
bool key_UnsoHandler ( adl_atUnsolicited_t * Param )
{
adl_atSendResponse(ADL_AT_UNS, "key_UnsoHandler\n");
u8 iKey = KEY_NONE,
iPressed = 1;
ascii lBuffer[ 3 ];
/* Last pressed key */
static u8 iPressedKey = KEY_NONE;
/* Get Key code */
if ( Param )
{
iKey = wm_atoi ( wm_strGetParameterString ( lBuffer, Param->StrData, 1 ) );
iPressed = wm_atoi ( wm_strGetParameterString ( lBuffer, Param->StrData, 2 ) );
}
if ( iPressed )
{
/* Key Pressed */
if ( iKey != KEY_NONE )
{
/* Save the pressed key */
iPressedKey = iKey;
/* Start the Key timer on the first time */
if ( key_RepeatTickDelay )
{
tRepeat = adl_tmrSubscribe ( FALSE, key_RepeatTickDelay, ADL_TMR_TYPE_TICK, key_TimerHandler );
}
}
//TRACE (( key_TraceLevel, "Key pressed %d", iPressedKey ));
/* Call Key handler */
if ( key_Handler )
{
key_Handler ( iPressedKey, iPressed );
}
}
else
{
/* Stop the Key timer */
adl_tmrUnSubscribe ( tRepeat, key_TimerHandler, ADL_TMR_TYPE_TICK );
tRepeat = NULL;
//TRACE (( key_TraceLevel, "Key released %d", iPressedKey ));
/* Call Key handler */
if ( key_Handler )
{
key_Handler ( iPressedKey, iPressed );
}
/* Reset the saved key */
iPressedKey = KEY_NONE;
}
/* Do not display keyboard events */
return FALSE;
}
void KeyHandler(u8 Key, u8 Pressed){
adl_atSendResponse(ADL_AT_UNS, "key_Handler\n");
}
/* Keyboard handler subscription */
void key_Subscribe ( key_Handler_f KeyHandler, u32 RepeatTickTime, u32 RepeatTickDelay )
{
adl_atSendResponse(ADL_AT_UNS, "key_Subscribe\n");
//TRACE (( key_TraceLevel, "Keyboard Handler Subscription (%d,%d)", RepeatTickTime, RepeatTickDelay ));
/* Set Keyboard Handler */
key_Handler = KeyHandler;
/* Set Repeat Timers parameters */
key_RepeatTickTime = RepeatTickTime ? RepeatTickTime : 1;
key_RepeatTickDelay = RepeatTickDelay;
if ( bOnce )
{
/* Only first time */
bOnce = FALSE;
/* Send command to get keyboard events */
adl_atCmdCreate ( "at+cmer=,1", FALSE, ( adl_atRspHandler_t ) NULL, NULL );
/* Subscribe to Keyboard events */
adl_atUnSoSubscribe ( "+CKEV: ", key_UnsoHandler );
}
}
/* Keyboard handler Unsubscription */
void key_Unsubscribe ( key_Handler_f KeyHandler )
{
adl_atSendResponse(ADL_AT_UNS, "key_unSubscribe\n");
//TRACE (( key_TraceLevel, "Keyboard Handler Unsubscription" ));
if ( KeyHandler == key_Handler )
{
/* Unsubscribe from keyboard handler */
adl_atCmdCreate ( "at+cmer=,0", FALSE, ( adl_atRspHandler_t ) NULL, NULL );
adl_atUnSoUnSubscribe ( "+CKEV: ", key_UnsoHandler );
key_Handler = NULL;
/* Unsubscribe from all timers */
if ( tRepeat )
{
adl_tmrUnSubscribe ( tRepeat, key_TimerHandler, ADL_TMR_TYPE_TICK );
tRepeat = NULL;
}
bOnce = TRUE;
}
}
void adl_main(adl_InitType_e adlInitType)
{
adl_atSendResponse(ADL_AT_UNS, "Start of the Programm\n");
key_Subscribe(KeyHandler, 1, 1);
}
and this is the entire output from when i start the programm via the “run as…” button
at+cfun=1ý
atatat
OK
OK
OK
OK
+WIND: 3
+WIND: 13
Start of the Programm
key_Subscribe
at+wopen=1
OK