~ubuntu-branches/ubuntu/quantal/autokey/quantal

« back to all changes in this revision

Viewing changes to src/lib/scripting.py

  • Committer: Bazaar Package Importer
  • Author(s): Luke Faraone
  • Date: 2010-07-30 10:28:39 UTC
  • mfrom: (1.4.1 upstream) (11.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100730102839-073mvbvx74j9xq5y
Tags: 0.71.0-1
* New upstream version
* Install changelog in package
* Bump standards version to 3.9.1, no changes needed.
* Remove in-package mentions of dpatch, it is no longer used

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        for x in xrange(repeat):
58
58
            self.mediator.send_key(key.decode("utf-8"))
59
59
        self.mediator.flush()
 
60
        
 
61
    def press_key(self, key):
 
62
        """
 
63
        Send a key down event
 
64
        
 
65
        Usage: C{keyboard.press_key(key)}
 
66
        
 
67
        The key will be treated as down until a matching release_key() is sent.
 
68
        @param key: they key to be pressed (e.g. "s" or "<enter>")
 
69
        """
 
70
        self.mediator.press_key(key.decode("utf-8"))
 
71
        
 
72
    def release_key(self, key):
 
73
        """
 
74
        Send a key up event
 
75
        
 
76
        Usage: C{keyboard.release_key(key)}
 
77
        
 
78
        If the specified key was not made down using press_key(), the event will be 
 
79
        ignored.
 
80
        @param key: they key to be released (e.g. "s" or "<enter>")
 
81
        """
 
82
        self.mediator.release_key(key.decode("utf-8"))        
60
83
 
61
84
    def fake_keypress(self, key, repeat=1):
62
85
        """