STOP THE PRESS :-) Thanks guys for the advice - will go for 50ms and think about the key buffer idea. ************************************************* Roy Hopkins rdhopkins@ihug.co.nz ************************************************* > years ago I've made a routine for treating buttoms that I'm still using. > > It runs on an interrupt that occurs once every millisecond on most > applications and have a keyDebounce variable that usually (with no key > pressed) have it's value equal to 50. > > While a key is pressed the routine decrements keyDebounce. When > keyDebounce is equal zero, the code of the key is put on the keyBuffer > variable and keyDebounce = 250. > > Next time (we also have a keyCounter variable) the keyDebounce is > equal zero, key code is put on keyBuffer again a now keyDebounce =50. > > It makes a nice repeating keyboard implementation and you could even > implements "accelerating" keypresses. It works very well with all the > buttoms/keys I've tried. I think I already used more than 6 kind of buttoms. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.554 / Virus Database: 346 - Release Date: 20/12/2003 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu