[orca-list] Detecting Double Key Press in orca-customizations.py

I know double key presses are used in things like the where a I function. I was wondering how to add this in to the customizations.py file too.  I tried writing my own, but although the code works in stand alone form, it doesn't work in the customizations file. Just for reference, here's the code:
import time
class countPresses:
    def __init__(self):
        self.clicks = 0
        self.now = time.time()

    def clickCount(self):
        if time.time() <= self.now + 0.75:
            self.clicks += 1
        self.now = time.time()
        if self.clicks > 2: self.clicks = 1
        return self.clicks

test = countPresses()
print str(test.clickCount())
print str(test.clickCount())
print str(test.clickCount())
print str(test.clickCount())

Thoughts of a Dragon:
What color dragon are you?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]