Problem solved. I suddenly realised, while watching the output of the print statements, that I don't need the update function. Instead the control statements should be in the keyboard reading functions. Advice for self; don't bother the mailing list but instead give the problem a rest for a day or two. -- Regards, Phil