Assigning sounds to hardware buttons

Postby rantman on Mon Dec 03, 2001 2:16 pm

Does anybody know how i would go about assigning a sound (i.e. tone(440, 440) to each hardware button on the palm pilot in pocketC

------------------------
http://www.geocities.com/rant_manca
visit for some humorous rants.
------------------------
http://www.geocities.com/rant_manca
visit for some humorous rants.
rantman
 
Posts: 7
Joined: Sat Dec 01, 2001 6:22 pm

Postby degv on Mon Dec 03, 2001 3:37 pm

You will obviously use hookhard to grab the user pressing the key and then read the input. You can have whatever happen that you like when the user presses the key.
For example here is a snippet from a program I wrote....

hookhard(1);
e=event(1); // wait for an event

if(e == 5){y=y + 30;
if (y>60){y=60;}
}
else if(e == 6){y=y - 30;
if (y<-300){y=-300;}
}



I'm modifying my y variable when the user presses the key. You could easily substitue a tone command in place of my change to the y variable.

I hope this helps,

David
degv
 
Posts: 47
Joined: Tue Jul 31, 2001 3:26 pm
Location: United Kingdom


Return to PocketC for Palm OS KB

Who is online

Users browsing this forum: No registered users and 2 guests

cron