From ae531b94017204ad52c86461566df64b354715c6 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Tue, 31 Jan 2012 17:43:08 +0100 Subject: [PATCH] textinput: fix invalid selection done when releasing shift key --- doc/sources/kivystyle.sty | 1 + kivy/uix/textinput.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/sources/kivystyle.sty b/doc/sources/kivystyle.sty index ed75d8e6c..e8f868c6e 100644 --- a/doc/sources/kivystyle.sty +++ b/doc/sources/kivystyle.sty @@ -1,3 +1,4 @@ + \definecolor{TitleColor}{rgb}{0,0,0} % Make links the same color as links on the website \definecolor{InnerLinkColor}{rgb}{0.875,0.392,0.133} diff --git a/kivy/uix/textinput.py b/kivy/uix/textinput.py index e2d7f1843..77eb43e48 100644 --- a/kivy/uix/textinput.py +++ b/kivy/uix/textinput.py @@ -909,7 +909,8 @@ class TextInput(Widget): def _key_up(self, key, repeat=False): displayed_str, internal_str, internal_action, scale = key if internal_action in ('shift', 'shift_L', 'shift_R'): - self._update_selection(True) + if self._selection: + self._update_selection(True) def _keyboard_on_key_down(self, window, keycode, text, modifiers): global Clipboard