PDA

View Full Version : EvtEnqueueKey


Cyker
02-27-2005, 12:30 PM
Righty, I still haven't been able to figure out this little problem, so if anyone has any insight, please post here because it's driving me inssaaaannnneee!

*ahem*

Anyway, I'm trying to code a DA version of SharkBoy's Audio Player RMC app, so you can just call it up and tap on buttons to play, pause, rewind etc.

I'm using the keycodes Sharky found to do this, so for instance when you tap on 'Play' I do:

EvtEnqueueKey(5898,3303,8);
EvtEnqueueKey(5899,3303,8);

to send the Play command.

Now, this works for Sharky's hardbutton version, but for some reason the DA one isn't passing the key events out - They're getting lost somewhere!!

Does anyone have any insight into this? I was hoping it was something obvious, but now I just think it's something simple (Which means I'll never figure it out except by blind luck :D)...

Sharkk717
02-27-2005, 03:41 PM
hey cyker! just had an idea... might work. did you try typecasting the parameters? so it would look like:

EvtEnqueueKey((WChar)5898,(UInt16)3303,(UInt16)8);

regards, sharky

Tam Hanna
02-28-2005, 11:08 AM
I beleive something else(We already discussed it in email):
The Key Codes usually are handled by the Application currently running or by SysHandleEvent(on OS4). If there is another App(not the Audio Player) running, the codes "should" not get to the Audio Player-unless Sony has some tweak going on here...

Sharkk717
02-28-2005, 03:53 PM
actually tam... the AudioPlayer app is registered to receive VirtualChar notifications. that's why you can control AudioPlayer from anywhere using the Clie RMC controller :D It's not just a Sony tweak either... all applications can do this :D Please see this page for more info on notifications:
http://www.palmos.com/dev/support/docs/palmos/Notifications.html

if you hand off key codes to the system this should work, but the system should get a shot at these chars anyway. maybe cliepet can shed some light?

regards, sharky

Cyker
02-28-2005, 05:08 PM
Damnit, I hate Firefox!
Anyway, the short version of my now oblivionised post was that I tried the type-casting (The Palm Docs have a big warning under the EvtEnqueueKey entry, about WChar vs. high-ascii so I tried it as a last straw-clutching grab ;))

Still doesn't work :(

I'm actually calling the SysHandleEvent routine as part of my event handler loop, but it's still noy catching the key event. I tried putting a GetEvent and SysHandleEvent right after the call to my Form's event handler, but this caused horrible things to happen... :)

It's a real puzzler... I'm thinking perhaps I need to attach a notification hook somewhere... but to what and how...?

My braaainn....