~ubuntu-branches/ubuntu/utopic/sikuli/utopic

« back to all changes in this revision

Viewing changes to docs/source/keys.rst

  • Committer: Bazaar Package Importer
  • Author(s): Gilles Filippini
  • Date: 2011-10-04 23:32:13 UTC
  • mfrom: (4.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20111004233213-36fm78hx0z53tkuw
Tags: 1.0~x~rc3-dfsg1-2
* New patch fix-cmake-sikuli-ide.patch:
  + Fix random FTBFS due to missing inter target dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
modifiers can be found in :ref:`Acting on a Region <ActingonaRegion>` and :ref:`Low
8
8
Level Mouse and Keyboard Actions <LowLevelMouseAndKeyboardActions>`.
9
9
 
10
 
Key Modifiers
11
 
-------------
12
 
 
13
 
Methods where key modifiers can be used include: :py:meth:`click() <Region.click>`,
14
 
:py:meth:`dragDrop() <Region.dragDrop>` , :py:meth:`doubleClick()
15
 
<Region.doubleClick>` , :py:meth:`rightClick() <Region.rightClick>`,
16
 
:py:meth:`type() <Region.type>`.
17
 
 
18
 
**the oldies but goldies** ::
19
 
 
20
 
        KEY_ALT, KEY_CTRL, KEY_SHIFT
21
 
 
22
 
**system specific Win/Mac** ::
23
 
 
24
 
        KEY_WIN, KEY_CMD 
25
 
        KEY_META (a synonym for KEY_WIN or KEY_CMD on Windows and Mac respectively).
26
 
        
27
 
The modifier constants can be combined to the modifier parameter by either using "+" or "|", if more than one key modifier is needed. ::
28
 
 
29
 
        type(Key.ESC, KEY_CTRL + KEY_ALT)
30
 
        # or equivalent
31
 
        type(Key.ESC, KEY_CTRL | KEY_ALT)
32
 
 
33
 
They should **only** be used in the
34
 
modifiers parameter with functions like :py:meth:`type() <Region.type>`, :py:meth:`rightClick() <Region.rightClick>`, etc. 
35
 
 
36
 
They should **never** be used with :py:meth:`keyDown() <Region.keyDown>` or :py:meth:`keyUp() <Region.keyUp>`.
37
 
 
38
 
*Note for Java programming*: These constants are mapped to the according constants of the Java environment
39
 
in the class ``java.awt.event.InputEvent``. 
40
 
 
41
10
 
42
11
Special Keys
43
12
------------
57
26
 
58
27
        ENTER, TAB, ESC, BACKSPACE, DELETE, INSERT
59
28
 
 
29
.. versionadded:: X1.0-rc3
 
30
 
 
31
**miscellanous keys** ::
 
32
 
 
33
        SPACE
 
34
 
60
35
**function keys** ::
61
36
 
62
37
        F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15
79
54
        NUM0, NUM1, NUM2, NUM3, NUM4, NUM5, NUM6, NUM7, NUM8, NUM9
80
55
        SEPARATOR, ADD, MINUS, MULTIPLY, DIVIDE
81
56
 
82
 
**key modifiers** ::
 
57
**modifier keys** ::
83
58
 
84
59
        ALT, CMD, CTRL, META, SHIFT, WIN
85
60
 
86
 
These key modifiers can **not** be used  with functions
 
61
These modifier keys **cannot** be used as a key modifier with functions
87
62
like :py:meth:`type() <Region.type>`, :py:meth:`rightClick() <Region.rightClick>`, etc. 
88
 
 
89
63
They can **only** be used with :py:meth:`keyDown() <Region.keyDown>` and :py:meth:`keyUp() <Region.keyUp>`.
 
64
If you need key modifiers, use :py:class:`KeyModifier` instead.
 
65
 
 
66
Key Modifiers
 
67
-------------
 
68
 
 
69
Methods where key modifiers can be used include: :py:meth:`click() <Region.click>`,
 
70
:py:meth:`dragDrop() <Region.dragDrop>` , :py:meth:`doubleClick()
 
71
<Region.doubleClick>` , :py:meth:`rightClick() <Region.rightClick>`,
 
72
:py:meth:`type() <Region.type>`.
 
73
 
 
74
.. deprecated:: X1.0-rc3
 
75
 
 
76
**the oldies but goldies** ::
 
77
 
 
78
        KEY_ALT, KEY_CTRL, KEY_SHIFT
 
79
 
 
80
**system specific Win/Mac** ::
 
81
 
 
82
        KEY_WIN, KEY_CMD 
 
83
        KEY_META (a synonym for KEY_WIN or KEY_CMD on Windows and Mac respectively).
 
84
 
 
85
The old modifiers with a *KEY_* prefix are deprecated. Use ``KeyModifier.CTRL``, ``KeyModifier.ALT``, ``KeyModifier.SHIFT``, ``KeyModifier.META`` instead.
 
86
 
 
87
 
 
88
.. versionadded:: X1.0-rc3
 
89
.. py:class:: KeyModifier
 
90
 
 
91
Usage: `KeyModifier.CONSTANT` (where CONSTANT is one of the following key names).
 
92
 
 
93
   .. py:data:: CTRL
 
94
      equivalent to the old KEY_CTRL
 
95
   .. py:data:: SHIFT
 
96
      equivalent to the old KEY_SHIFT
 
97
   .. py:data:: ALT
 
98
      equivalent to the old KEY_ALT
 
99
   .. py:data:: META
 
100
      equivalent to the old KEY_META
 
101
   .. py:data:: CMD
 
102
      equivalent to the old KEY_CMD (and KEY_META)
 
103
   .. py:data:: WIN
 
104
      equivalent to the old KEY_WIN (and KEY_META)
 
105
 
 
106
        
 
107
The modifier constants can be combined to the modifier parameter by either using "+" or "|", if more than one key modifier is needed. ::
 
108
 
 
109
        type(Key.ESC, KeyModifier.CTRL + KeyModifier.ALT)
 
110
        # or equivalent
 
111
        type(Key.ESC, KeyModifier.CTRL | KeyModifier.ALT)
 
112
 
 
113
They should **only** be used in the
 
114
modifiers parameter with functions like :py:meth:`type() <Region.type>`, :py:meth:`rightClick() <Region.rightClick>`, etc. 
 
115
 
 
116
They should **never** be used with :py:meth:`keyDown() <Region.keyDown>` or :py:meth:`keyUp() <Region.keyUp>`.
 
117
 
 
118
*Note for Java programming*: These constants are mapped to the according constants of the Java environment
 
119
in the class ``java.awt.event.InputEvent``. 
 
120