Skip to content

Commit 64e9bbb

Browse files
committed
Hard wrap the paragraphs
1 parent aad7e3a commit 64e9bbb

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

docs/quickstart.rst

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ The most common use case, of course, simply invokes a script:
2424
2525
ahkpy myscript.py
2626
27-
The REPL interface works best when you invoke it with the ``python``
28-
executable, which allows you to explore your command history with the up and
29-
down arrow keys.
27+
The REPL interface works best when you invoke it with the ``python`` executable,
28+
which allows you to explore your command history with the up and down arrow
29+
keys.
3030

3131
.. code-block:: text
3232
@@ -60,7 +60,8 @@ following sequence:
6060
is, AutoHotkey.py uses the environment variable as the AutoHotkey executable
6161
path.
6262
2. If not, checks the Windows Registry to find whether a program's set to run
63-
when a user opens an AHK file.
63+
when a user opens an AHK file. If the program name starts with ``autohotkey``
64+
(case-insensitive), AutoHotkey.py uses it as the AutoHotkey executable path.
6465
3. Otherwise, defaults to the path
6566
``C:\Program Files\AutoHotkey\AutoHotkey.exe``.
6667

@@ -76,10 +77,9 @@ when a user opens an AHK file.
7677
Hotkeys
7778
-------
7879

79-
The :func:`hotkey` function registers HotKeys. In the
80-
following example, the hotkey :kbd:`Win`+ :kbd:`N` is configured to launch
81-
Notepad. The pound sign ``#`` stands for the :kbd:`Win` key, one of the hotkey
82-
modifiers::
80+
The :func:`hotkey` function registers Hotkeys. In the following example, the
81+
hotkey :kbd:`Win`+ :kbd:`N` is configured to launch Notepad. The pound sign
82+
``#`` stands for the :kbd:`Win` key, one of the hotkey modifiers::
8383

8484
import subprocess
8585
import ahkpy
@@ -93,9 +93,8 @@ If you want to bind an existing function to a hotkey, pass it as an argument to
9393

9494
ahkpy.hotkey("#n", subprocess.Popen, ["notepad"])
9595

96-
In the preceding example, when a user presses :kbd:`Win`+ :kbd:`N`,
97-
they create a :class:`subprocess.Popen` object with the argument
98-
``["notepad"]``.
96+
In the preceding example, when a user presses :kbd:`Win`+ :kbd:`N`, they create
97+
a :class:`subprocess.Popen` object with the argument ``["notepad"]``.
9998

10099
To disable a key or a combination of keys for the entire system, use the
101100
``lambda: None`` function. For example, this disables the right-side :kbd:`Win`
@@ -105,8 +104,8 @@ key::
105104

106105
If you want to specify certain conditions when a hotkey performs a different
107106
action (or no action at all), you can use the methods
108-
:meth:`Windows.active_window_context` and :meth:`Windows.window_context`,
109-
or the class :class:`HotkeyContext`. For example::
107+
:meth:`Windows.active_window_context` and :meth:`Windows.window_context`, or the
108+
class :class:`HotkeyContext`. For example::
110109

111110
notepad_ctx = ahkpy.windows.active_window_context(class_name="Notepad")
112111
notepad_ctx.hotkey(
@@ -175,17 +174,17 @@ Window Management
175174
-----------------
176175

177176
AutoHotkey.py provides the :class:`Windows` class and its default instances:
178-
:data:`windows` and :data:`all_windows`. With the :class:`Windows` class
179-
interface, you can query windows through multiple search parameters, like
180-
``title`` and ``window``. To query the windows, set the criteria with the
181-
:meth:`~Windows.filter` method. For example, this prepares a query of all
182-
windows of the class ``ConsoleWindowClass``::
177+
:data:`windows` and :data:`all_windows`. With the :class:`Windows` class, you
178+
can query windows through multiple search parameters, like title and window
179+
class. To query the windows, set the criteria with the :meth:`~Windows.filter`
180+
method. For example, this prepares a query of all windows of the class
181+
``ConsoleWindowClass``::
183182

184183
>>> console_windows = ahkpy.windows.filter(class_name="ConsoleWindowClass")
185184

186-
The only role of the :meth:`~Windows.filter` method is to pack the
187-
query parameters. Once you've filtered the object you want, you can perform
188-
a real operation, like get the count of matching windows::
185+
The only role of the :meth:`~Windows.filter` method is to pack the query
186+
parameters. Once you've set the filters you want, you can perform a real
187+
operation, like get the count of matching windows::
189188

190189
>>> console_windows
191190
Windows(class_name='ConsoleWindowClass', hidden_windows=False, hidden_text=True, title_mode='startswith', text_mode='fast')
@@ -200,10 +199,10 @@ a real operation, like get the count of matching windows::
200199
>>> [win.title for win in console_windows]
201200
['Command Prompt', 'Windows PowerShell', 'C:\\Windows\\py.exe']
202201

203-
Specifying multiple criteria for :meth:`~Windows.filter` narrows the
204-
the search down to only the windows where *all* criteria match. In the
205-
following example, the script waits for a window whose title contains
206-
``My File.txt`` and whose class is ``Notepad``::
202+
Specifying multiple criteria for :meth:`~Windows.filter` narrows the search down
203+
to only the windows where *all* criteria match. In the following example, the
204+
script waits for a window whose title contains ``My File.txt`` and whose class
205+
is ``Notepad``::
207206

208207
ahkpy.windows.filter("My File.txt", class_name="Notepad").wait()
209208
# Filter chaining gives the same result.

0 commit comments

Comments
 (0)