Package virtual_keyboard :: Module virtual_keyboard :: Class VirtualKeyboard
[hide private]
[frames] | no frames]

Class VirtualKeyboard

source code

object --+
         |
        VirtualKeyboard

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
typeControlCharToActiveWindow(self, theStr)
Type a given keystroke.
source code
 
typeTextToActiveWindow(self, theStr)
Type a given string, which must not contain control chars.
source code
 
mouseClick(self, buttonNum)
Buttons map this way: Left mouse is 1, middle is 2, right is 3, wheel up is 4, wheel down is 5.
source code
 
mouseDown(self, buttonNum)
Buttons map this way: Left mouse is 1, middle is 2, right is 3, wheel up is 4, wheel down is 5.
source code
 
mouseUp(self, buttonNum)
Buttons map this way: Left mouse is 1, middle is 2, right is 3, wheel up is 4, wheel down is 5.
source code
 
getMouseGlobalPos(self)
Return a dictionary that provides 'x' and 'y' keys, whose values are integer x and y coordinates of the mouse cursor.
source code
 
moveMouseAbsolute(self, x, y)
Move mouse cursor to absolute position relative to upper left corner of display.
source code
 
moveMouseRelative(self, x, y)
Move mouse cursor new position relative to where it is currently located.
source code
 
saveActiveWindowID(self, retrievalKey)
Internally saves the currently active X11 window's ID.
source code
 
windowsEqual(self, retrievalKey1, retrievalKey2) source code
 
activateWindow(self, retrievalKey=None, windowTitle=None)
Activates the X11 window with the given window ID.
source code
 
getWindowGeometry(self, retrievalKey=None) source code
 
raiseWindow(self, retrievalKey=None)
Flakey; don't rely on it.
source code
 
_getWinIDSafely_(self, retrievalKey) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

typeControlCharToActiveWindow(self, theStr)

source code 

Type a given keystroke. Examples being "alt+r", "Control_L+J", "ctrl+alt+n", "BackSpace", "Linefeed". Generally, any valid X Keysym string will work. Composited control keys are separated by '+'. Aliases exist for "alt", "ctrl", "shift", "super", and "meta" which all map to Foo_L, such as Alt_L and Control_L, etc.

Parameters:
  • theStr (string) - control-char string to send to active window

typeTextToActiveWindow(self, theStr)

source code 

Type a given string, which must not contain control chars. For sending individual control chars, use typeControlCharToActiveWindow().

Parameters:
  • theStr (string) - control-char string to send to active window

mouseClick(self, buttonNum)

source code 

Buttons map this way: Left mouse is 1, middle is 2, right is 3, wheel up is 4, wheel down is 5.

Parameters:
  • buttonNum (int) - which mouse button to click

mouseDown(self, buttonNum)

source code 

Buttons map this way: Left mouse is 1, middle is 2, right is 3, wheel up is 4, wheel down is 5.

Parameters:
  • buttonNum (int) - which mouse button to hold down

mouseUp(self, buttonNum)

source code 

Buttons map this way: Left mouse is 1, middle is 2, right is 3, wheel up is 4, wheel down is 5.

Parameters:
  • buttonNum (int) - which mouse button to hold down

getMouseGlobalPos(self)

source code 

Return a dictionary that provides 'x' and 'y' keys, whose values are integer x and y coordinates of the mouse cursor. The position is relative to the upper left corner of the display.

moveMouseAbsolute(self, x, y)

source code 

Move mouse cursor to absolute position relative to upper left corner of display.

Parameters:
  • x (int) - horizontal coordinate
  • y (int) - vertical coordinate

moveMouseRelative(self, x, y)

source code 

Move mouse cursor new position relative to where it is currently located. It is legal to use negative offsets for x and/or y.

Parameters:
  • x (int) - horizontal coordinate
  • y (int) - vertical coordinate

saveActiveWindowID(self, retrievalKey)

source code 

Internally saves the currently active X11 window's ID. Use getRecentWindow() to retrieve the ID for use with later xdotool commands.

Parameters:
  • retrievalKey (string) - key under which caller will ask for the ID later on.

activateWindow(self, retrievalKey=None, windowTitle=None)

source code 

Activates the X11 window with the given window ID. If windowID is omitted, the most recently active window is activated (see getRecentWindow()).

Parameters:
  • retrievalKey (string) - key under which caller asked to associate with window in earlier call to saveActiveWindowID

raiseWindow(self, retrievalKey=None)

source code 

Flakey; don't rely on it.

Parameters:
  • retrievalKey ()