[gnome-music] Support different keyboard layouts in search on keypress function



commit 41b5941fdc3ce5da2da2a942eba99845090d57ce
Author: Anton Belka <antonbelka gmail com>
Date:   Mon Mar 3 05:19:34 2014 +0300

    Support different keyboard layouts in search on keypress function
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723942

 gnomemusic/window.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index 257fc36..daa75ee 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -237,8 +237,9 @@ class Window(Gtk.ApplicationWindow):
             self.toolbar.searchbar.show_bar(False)
             if self.toolbar._selectionMode:
                 self.toolbar.set_selection_mode(False)
-        elif (event.state & modifiers) == 0 and \
-                event.keyval in range(33, 126) and \
+        elif (event.state & modifiers) == Gdk.ModifierType.SHIFT_MASK or (event.state & modifiers) == 0 and \
+                GLib.unichar_isprint(chr((Gdk.keyval_to_unicode(event.keyval)))) and \
+                not event.keyval == Gdk.KEY_space and \
                 not self.toolbar.searchbar.get_reveal_child():
             self.toolbar.searchbar.show_bar(True)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]