It seems that at a lower level, no keyHoldEvent events are generated.  Do a 
warm reset on a TX and run a utility that calls EvtGetEvent() to display 
key*Event events, and you will find there are no keyHoldEvent events there at 
all (what tipped me off is that in the Simulator, no keyHoldEvent events show 
up in the events log).  Instead of a keyHoldEvent event, a keyDownEvent event 
is generated but with the doubleTapKeyMask (0x80) flag set in the modifiers 
field.  And it is this event that my 'hede' handler sees.  I am guessing there 
is an EvtGetEvent() patch.

Unfortunately, I still can't figure out how to pre-empt the recent apps popup 
on the TX, because the 'hede' notification for holding down hard key 1 occurs 
AFTER the popup shows up.

Interestingly, keyUpEvent events for the 5-way also do not seem show up to 
'hede'.  Instead it seems (I ran a key logger after a warm reset to check 
this), at a lower level keyDownEvent events are generated with the 
powerOnKeyMask (0x100) flag set.  These are not generated for the hard 1-4 keys.

This is all a rather ugly patchwork.

I still need a good way to distinguish, from within a 'hede' handler, a short 
press from a long press.  The best I can think of is after each keyDownEvent 
that does NOT have doubleTapKeyMask set is to set a timer for double the length 
of time a key repeat takes.  If no autoRepeatKeyMask or doubleTapKeyMask-marked 
event is seen by 'hede' in that time, then it's a short press.  

Or maybe I should just patch SysHandleEvent(), which would let apps override 
what I'm doing, which is nicer.
-- 
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to