Discussion:
[SysTrap functions] What's the parameter list?
(too old to reply)
Jan Exner
2003-09-01 16:43:02 UTC
Permalink
Thanks, Bob. What I was trying to do is as simple as providing
custom handler for keyDownEvent. Instead of looking the "Palm OS DB"
and return a default character. I would like to map the keyDownEvent
to my function so that when user tries to write a "s", my function
will return other character, let's say "t".
Question: Do you need this behaviour in your own application or
system-wide?

In the second case, you need to write a hack, but in the first case,
it would be as simple as writing some handler code within the event
loop.

HTH,
Jan
--
Jan Exner · ***@gmx.net · 0x9E0D3E98 · http://www.jan-exner.de/

Neues aus Frankreich http://www.jan-exner.de/france.html
Victor
2003-09-12 10:33:15 UTC
Permalink
I need this behaviour in system-wide, so I think hack is the best
option. However so far, I haven't been able to compile and run even
the simplest hack:

#include <PalmOS.h> // standard Palm OS Header

#define mycreator 'CHRH'

#define myresourceID 1000

Boolean MySysHandleEventTrap (EventPtr event)

{

Boolean (*oldtrap)(EventPtr);

UInt32 temp;

FtrGet(mycreator,myresourceID,&temp);

oldtrap=(Boolean (*)(EventPtr))temp;

return oldtrap(event);
}


And I did as follows:

pilrc resource.rcp

m68k-palmos-gcc charhack.c -o charhack -nostartfiles

m68k-palmos-obj-res charhack.c

build-prc charhack.prc -t HACK "Char-Hack" CHRH *.grc *.bin

All run without any error. However when I run it using my XMaster.
When I
activate this code. I saw that it traps the sysHandleEvent but I got
Fatal Alert when I activate it:

hacks.c, Line:596, no code resource for trap [Reset].


I tried to patch another system trap but it shows similar error.
Please help.


Regards,

Victor
Post by Jan Exner
Thanks, Bob. What I was trying to do is as simple as providing
custom handler for keyDownEvent. Instead of looking the "Palm OS DB"
and return a default character. I would like to map the keyDownEvent
to my function so that when user tries to write a "s", my function
will return other character, let's say "t".
Question: Do you need this behaviour in your own application or
system-wide?
In the second case, you need to write a hack, but in the first case,
it would be as simple as writing some handler code within the event
loop.
HTH,
Jan
Loading...