[orca-list] Detecting Double Key Press in orca-customizations.py
- From: Storm Dragon <stormdragon2976 gmail com>
- To: Orca-list <orca-list gnome org>
- Subject: [orca-list] Detecting Double Key Press in orca-customizations.py
- Date: Sun, 13 Dec 2009 15:33:22 -0500
Hi,
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())
time.sleep(3)
print str(test.clickCount())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]