Skip to content

Commit

Permalink
Update to version 0.10.1
Browse files Browse the repository at this point in the history
This version fixes backwards-incompatible changes to the Text action.

- Disable the Text action's Unicode keyboard functionality by
  default.
- Make action_text.load_configuration() write default values to the
  file.
- Add more documentation for Text.
  • Loading branch information
drmfinlay committed Jan 6, 2019
1 parent dc5336b commit 4882ef7
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 6 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ Note: this project had no release versions between 0.6.6b1_ and
0.7.0_. Notable changes made between these versions are documented in the
commit history and will be placed under headings in this file over time.

0.10.1_ - 2019-01-06
--------------------

Fixed
~~~~~
* Disable **backwards-incompatible** Unicode keyboard functionality by
default for the :class:`Text` action. Restoring the old behaviour
requires deleting/modifying the `~/.dragonfly2-speech/settings.cfg`
file.


0.10.0_ - 2018-12-28
--------------------
Expand Down Expand Up @@ -217,7 +227,8 @@ This release is the first in the Git version control system.


.. Release links.
.. _Unreleased: https://github.com/Danesprite/dragonfly/compare/0.10.0...HEAD
.. _Unreleased: https://github.com/Danesprite/dragonfly/compare/0.10.1...HEAD
.. _0.10.1: https://github.com/Danesprite/dragonfly/compare/0.10.0...0.10.1
.. _0.10.0: https://github.com/Danesprite/dragonfly/compare/0.9.1...0.10.0
.. _0.9.1: https://github.com/Danesprite/dragonfly/compare/0.9.0...0.9.1
.. _0.9.0: https://github.com/Danesprite/dragonfly/compare/0.8.0...0.9.0
Expand Down
44 changes: 40 additions & 4 deletions dragonfly/actions/action_text.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# encoding: utf-8
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
Expand Down Expand Up @@ -31,6 +32,40 @@
:class:`Text` action, but can be sent by the
:class:`dragonfly.actions.action_key.Key` action.
Windows Unicode Keyboard Support
............................................................................
The :class:`Text` action can be used to type arbitrary Unicode characters
using the `relevant Windows API <https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagkeybdinput#remarks>`__.
This is disabled by default because it ignores the up/down status of
modifier keys (e.g. ctrl).
It can be enabled by changing the ``unicode_keyboard`` setting in
`~/.dragonfly2-speech/settings.cfg` to ``True``::
unicode_keyboard = True
If you need to simulate typing arbitrary Unicode characters *and* have
*individual* :class:`Text` actions respect modifier keys normally for normal
characters, set the configuration as above and use the ``use_hardware``
parameter for :class:`Text` as follows:
.. code:: python
Text(u"σμ") + Key("ctrl:down") + Text("]", use_hardware=True) + Key("ctrl:up")
Some applications require hardware emulation versus Unicode keyboard
emulation. If you use such applications, add their executable names to the
``hardware_apps`` list in the configuration file mentioned above to make
dragonfly always use hardware emulation for them.
Text class reference
............................................................................
"""


Expand All @@ -46,7 +81,7 @@

# ---------------------------------------------------------------------------

UNICODE_KEYBOARD = True
UNICODE_KEYBOARD = False
HARDWARE_APPS = [
"tvnviewer.exe", "vncviewer.exe", "mstsc.exe", "virtualbox.exe"
]
Expand All @@ -73,9 +108,10 @@ def load_configuration():
os.mkdir(config_folder)
if not os.path.exists(config_path):
with io.open(config_path, "w") as f:
f.write(u'[Text]\nhardware_apps = '
u'tvnviewer.exe|vncviewer.exe|mstsc.exe|virtualbox.exe\n'
u'unicode_keyboard = true\n')
# Write the default values to the config file.
f.write(u'[Text]\n')
f.write(u'hardware_apps = %s\n' % "|".join(HARDWARE_APPS))
f.write(u'unicode_keyboard = %s\n' % UNICODE_KEYBOARD)

parser = configparser.ConfigParser()
parser.read(config_path)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.0
0.10.1

0 comments on commit 4882ef7

Please sign in to comment.