Re: [orca-list] Detecting Double Key Press in

Hi Storm:

When you create a keybinding, you can pass an option click count parameter to the constructor. Here's an example from that adds a double click:



Hope this helps,


On Dec 13, 2009, at 3:33 PM, Storm Dragon wrote:

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 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 = time.time()

    def clickCount(self):
        if time.time() <= + 0.75:
            self.clicks += 1 = 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?

Orca-list mailing list
Orca-list gnome org
Visit for more information on Orca.
The manual is at
The FAQ is at
Netiquette Guidelines are at
Log bugs and feature requests at

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