PDA

View Full Version : Disabling Keypress



ezNokia
17-07-2006, 08:51 PM
Hi all,


I'm having problem disabling keypress (during call).
I've tried hooking almost everywhere (idle, standby, ui_handler1/2,5e0 ID1...)without success to replace MSG_KEYPRESS by MSG_NOP !
Of course, i'm hooking with "R0" as parameter to be able to change "msg":


ezhook msg_process,hook_keypress,"R0"

Any help ? Its disapointing !

[EDITED :]

I've noticed some strange behaviours :

This sample (useless) code isn't modifying msg variable (keypress are still enabled) :


void hook_keypress(unsigned msg)
{

switch(msg)
{
case MSG_KEYPRESS:
msg=MSG_NOP; // Modifying R0 ???
break;
}
}


But, when i've tried to do some debugs using "printf", it seems that R0 is modified since keypress are disabled :



void hook_keypress(unsigned msg)
{

switch(msg)
{
case MSG_KEYPRESS:
printf("debug"); // Should modify R0 since keypress are disabled !
break;
}
}



What happens ? How to modify R0 like "printf" call do :-? Should i really use asm("MOV R0,#0xDC") ?