Skip to content

Commit 0ce5684

Browse files
author
dessant
committed
rename EmacsBehavior/CodeInput active_key_bindings to key_bindings
1 parent 6961874 commit 0ce5684

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

examples/widgets/codeinput.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
from kivy.core.window import Window
1010
from kivy.core.text import LabelBase
1111
from pygments import lexers
12-
from pygame import font as fonts
1312
import codecs
14-
import glob
1513
import os
1614

1715
example_text = '''
@@ -112,7 +110,8 @@ def cancel(self):
112110

113111
class CodeInputWithBindings(EmacsBehavior, CodeInput):
114112
'''CodeInput with keybindings.
115-
To add more bindings, add behavior before CodeInput in class definition
113+
To add more bindings, add the behavior before CodeInput in the class
114+
definition.
116115
'''
117116
pass
118117

@@ -166,7 +165,7 @@ def build(self):
166165
lexer=KivyLexer(),
167166
font_size=12,
168167
text=example_text,
169-
active_key_bindings='default',
168+
key_bindings='default',
170169
)
171170

172171
b.add_widget(self.codeinput)
@@ -205,7 +204,7 @@ def _file_menu_selected(self, instance, value):
205204

206205
def _bindings_selected(self, instance, value):
207206
value = value.split(' ')[0]
208-
self.codeinput.active_key_bindings = value.lower()
207+
self.codeinput.key_bindings = value.lower()
209208

210209
def on_files(self, instance, values):
211210
if not values[0]:

kivy/uix/behaviors/emacs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
This `mixin <https://en.wikipedia.org/wiki/Mixin>`_ allows you to add
99
`Emacs <https://www.gnu.org/software/emacs/>`_ keyboard shortcuts for basic
10-
movement and editing to the :class:`~kivy.uix.textinput.TextInput` widget.
10+
movement and editing to the :class:`~kivy.uix.codeinput.CodeInput` widget.
1111
The shortcuts currently available are listed below::
1212
1313
Emacs shortcuts
@@ -44,18 +44,18 @@
4444
class EmacsBehavior(object):
4545
'''
4646
A `mixin <https://en.wikipedia.org/wiki/Mixin>`_ that enables Emacs-style
47-
keyboard shortcuts for the :class:`~kivy.uix.textinput.TextInput` widget.
47+
keyboard shortcuts for the :class:`~kivy.uix.codeinput.CodeInput` widget.
4848
'''
4949

50-
active_key_bindings = StringProperty('emacs')
50+
key_bindings = StringProperty('emacs')
5151
'''String name which determines the type of key bindings to use with the
52-
:class:`~kivy.uix.textinput.TextInput`. This allows Emacs key bindings to
52+
:class:`~kivy.uix.codeinput.CodeInput`. This allows Emacs key bindings to
5353
be enabled/disabled programmatically for widgets that inherit from
54-
:class:`EmacsBehavior`. If the value is not ``'emacs'`` Emacs bindings will
55-
be disabled.
54+
:class:`EmacsBehavior`. If the value is not ``'emacs'``, Emacs bindings
55+
will be disabled.
5656
57-
:attr:`active_key_bindings` is a :class:`~kivy.properties.StringProperty`
58-
and defaults to ``'emacs'``
57+
:attr:`key_bindings` is a :class:`~kivy.properties.StringProperty`
58+
and defaults to ``'emacs'``.
5959
6060
.. versionadded:: 1.9.2
6161
'''

kivy/uix/codeinput.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ class CodeInput(CodeNavigationBehavior, TextInput):
8585
8686
'''
8787

88-
active_key_bindings = StringProperty('default')
89-
'''String name which determines the type of key bindings to use.
88+
key_bindings = StringProperty('default')
89+
'''Determines the type of key bindings to use.
9090
91-
:attr:`active_key_bindings` is a :class:`~kivy.properties.StringProperty`
92-
and defaults to ``'default'``
91+
:attr:`key_bindings` is a :class:`~kivy.properties.StringProperty`
92+
and defaults to ``'default'``.
9393
9494
.. versionadded:: 1.9.2
9595
'''

kivy/uix/textinput.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,7 @@ def _key_up(self, key, repeat=False):
22522252
self._alt_r = False
22532253

22542254
def keyboard_on_key_down(self, window, keycode, text, modifiers):
2255-
# Keycodes on OSX:
2255+
# Keycodes on OS X:
22562256
ctrl, cmd = 64, 1024
22572257
key, key_str = keycode
22582258
win = EventLoop.window

0 commit comments

Comments
 (0)