diff --git a/data/key-mapper.glade b/data/key-mapper.glade index dfdc4e6b..fb4fdfe9 100644 --- a/data/key-mapper.glade +++ b/data/key-mapper.glade @@ -1,45 +1,45 @@ - + True - False - dialog-ok + False + dialog-ok True - False - edit-delete + False + edit-delete - False + False Key Mapper True - center - mouse - dialog - True + center + mouse + dialog + True True - False + False vertical True - False + False center - end + end gtk-close - False + False True - True - True - False - True + True + True + False + True False @@ -51,22 +51,22 @@ False True - end + end 0 True - False + False True - False + False 0 12 12 - mouse + mouse 6 @@ -78,15 +78,15 @@ True - False - 10 + False + 10 vertical True - False + False 6 - True + True 0 @@ -98,9 +98,9 @@ True - False + False 6 - True + True 0 0 @@ -129,47 +129,44 @@ close_error_dialog - - - True - False - gtk-delete + False + gtk-delete True - False + False gtk-redo - False + False Key Mapper True - center - mouse - dialog - True + center + mouse + dialog + True True - False + False vertical True - False + False center - end + end Continue - False + False True - True - True - False + True + True + False gtk-delete-icon @@ -182,8 +179,8 @@ Go Back True - True - True + True + True gtk-redo-icon @@ -196,22 +193,22 @@ False True - end + end 0 True - False + False True - False + False 0 12 12 - mouse + mouse 6 @@ -223,12 +220,12 @@ True - False - 10 - 10 + False + 10 + 10 6 You have got unsaved changes! - True + True 0 0.5 @@ -251,50 +248,47 @@ go_back go_ahead - - - True - False + False gtk-redo True - False - document-new + False + document-new True - False - document-save + False + document-save - 700 - False + 700 + False Key Mapper - 350 - mouse + 350 + mouse True - False + False vertical True - False - 15 + False + 15 10 - 50 + 50 True - False + False Device - 13 + 13 0 @@ -306,7 +300,7 @@ True - False + False @@ -319,12 +313,12 @@ Apply Defaults True - True - True - To give your keys back their original mapping. + True + True + To give your keys back their original mapping. end gtk-redo-icon-2 - True + True @@ -343,7 +337,7 @@ True - False + False False @@ -354,34 +348,34 @@ True - False + False True - False + False vertical True - False - 15 + False + 15 vertical 10 True - False + False 10 Apply - 80 + 80 True - True - True - Presets need to be saved before they can be applied + True + True + Presets need to be saved before they can be applied check-icon - True + True @@ -393,12 +387,12 @@ Save - 80 + 80 True - True - True + True + True save-icon - True + True @@ -410,12 +404,12 @@ New - 80 + 80 True - True - True + True + True new-icon - True + True @@ -427,12 +421,12 @@ Delete - 80 + 80 True - True - True + True + True delete-icon - True + True @@ -451,15 +445,15 @@ True - False + False 10 - 50 + 50 True - False + False Preset - 13 + 13 0 @@ -470,9 +464,9 @@ - 200 + 200 True - False + False @@ -491,14 +485,14 @@ True - False + False 10 True - False + False Rename - 13 + 13 0 @@ -510,7 +504,7 @@ True - True + True True @@ -528,12 +522,12 @@ True - False + False True - False - To automatically apply the preset after your login if the device is alread connected. + False + To automatically apply the preset after your login if the device is alread connected. Automatically load this preset 0 @@ -546,7 +540,7 @@ True - True + True @@ -572,7 +566,7 @@ True - False + False False @@ -583,17 +577,17 @@ True - False + False True - False - 10 - 10 - 10 - 10 - 6 - 6 + False + 10 + 10 + 10 + 10 + 6 + 6 vertical 2 @@ -606,7 +600,7 @@ True - False + False False @@ -617,11 +611,11 @@ True - False - This is the keycode you just pressed, and that you see in the mappings to the right. - 10 - 10 - 4 + False + This is the keycode you just pressed, and that you see in the mappings to the right. + 10 + 10 + 4 False @@ -646,7 +640,7 @@ True - False + False False @@ -656,22 +650,22 @@ - 250 + 250 True - False + False vertical True - False + False - 130 + 130 True - False - Click on a cell below and hit a key on your device. Click the "Apply Defaults" beforehand. - 5 - 5 + False + Click on a cell below and hit a key on your device. Click the "Apply Defaults" beforehand. + 5 + 5 Key @@ -683,23 +677,21 @@ True - False - a-z, A-Z, 0-9, "KP_0" - "KP_9" -"Shift_L", "Shift_R", "Alt_L", "Alt_R" -"Control_R", "BTN_LEFT", -"r(3, k(a).w(500))", "h(a).k(b)" -"m(Control_L, k(a).k(x))" + False + Macro examples: +- k(a) +- r(3, k(a).w(500)) +- h(a).k(b) +- m(Control_L, k(a).k(x)) -Run `key-mapper-service --key-names` for more - -Macros: +Help: - r: repeats the execution of the second parameter - w: waits in milliseconds - k: writes a single keystroke - m: holds a modifier while executing the second parameter - h: executes the parameter as long as the key is pressed down - 5 - 5 + 5 + 5 Mapping @@ -710,9 +702,9 @@ Macros: - 50 + 50 True - False + False False @@ -733,7 +725,7 @@ Macros: True - False + False False @@ -744,16 +736,16 @@ Macros: True - True + True True - False + False True - False - none + False + none @@ -781,8 +773,5 @@ Macros: - - - diff --git a/keymapper/gtk/row.py b/keymapper/gtk/row.py index 2d41967c..7fee30c9 100644 --- a/keymapper/gtk/row.py +++ b/keymapper/gtk/row.py @@ -26,13 +26,18 @@ import evdev from gi.repository import Gtk, GLib -from keymapper.state import custom_mapping +from keymapper.state import custom_mapping, system_mapping from keymapper.logger import logger CTX_KEYCODE = 2 +store = Gtk.ListStore(str) +for name in system_mapping.list_names(): + store.append([name]) + + def to_string(ev_type, code): """A nice to show description of the pressed key.""" try: @@ -156,6 +161,11 @@ class Row(Gtk.ListBoxRow): previous=(None, None) ) + def match(self, completion, key, iter): + """Search the avilable names.""" + value = store.get_value(iter, 0) + return key in value.lower() + def put_together(self, character): """Create all child GTK widgets and connect their signals.""" delete_button = Gtk.EventBox() @@ -190,6 +200,12 @@ class Row(Gtk.ListBoxRow): character_input.set_alignment(0.5) character_input.set_width_chars(4) character_input.set_has_frame(False) + completion = Gtk.EntryCompletion() + completion.set_model(store) + completion.set_text_column(0) + completion.set_match_func(self.match) + character_input.set_completion(completion) + if character is not None: character_input.set_text(character) character_input.connect( diff --git a/readme/pylint.svg b/readme/pylint.svg index 2eb20879..a31dd1ad 100644 --- a/readme/pylint.svg +++ b/readme/pylint.svg @@ -1,23 +1,23 @@ - + - + - - + + pylint pylint - 9.7 - 9.7 + 9.67 + 9.67 \ No newline at end of file