Merge lp:~vikoadi/switchboard-plug-keyboard/fix-options into lp:~elementary-pantheon/switchboard-plug-keyboard/trunk

Proposed by Viko Adi Rahmawan
Status: Merged
Approved by: Cody Garver
Approved revision: 250
Merged at revision: 254
Proposed branch: lp:~vikoadi/switchboard-plug-keyboard/fix-options
Merge into: lp:~elementary-pantheon/switchboard-plug-keyboard/trunk
Diff against target: 185 lines (+36/-36)
2 files modified
src/Pages/Options/option_handler.vala (+30/-30)
src/Pages/Options/option_settings.vala (+6/-6)
To merge this branch: bzr merge lp:~vikoadi/switchboard-plug-keyboard/fix-options
Reviewer Review Type Date Requested Status
Viko Adi Rahmawan (community) Needs Resubmitting
elementary Pantheon team Pending
Review via email: mp+238176@code.launchpad.net

Commit message

* change to org.gnome.desktop.input-sources.xkb-options from org.gnome.libgnomekbd.keyboard.options
* change get_code and from_code because we dont need group+"\t" anymore

Description of the change

fix keyboard option setting
* change to org.gnome.desktop.input-sources.xkb-options from org.gnome.libgnomekbd.keyboard.options
* change get_code and from_code because we dont need group+"\t" anymore

To post a comment you must log in.
Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

It seems that hard coded keyboard option doesnt work, should use libgnomedesktop XkbInfo one

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

Just update the key, save libgnome-desktop-3.0 for later

review: Needs Resubmitting
Revision history for this message
Danielle Foré (danrabbit) wrote :

I can confirm this works for setting compose key to right alt. Super keys seem to not work for whatever reason. Might be eaten by Gala? Perhaps we shouldn't offer that as an option to consider
Bug #1355536 fixed.

Revision history for this message
Viko Adi Rahmawan (vikoadi) wrote :

which Super key that i need to remove?
personally i don't use compose key, but mapping Ctrl to Super does work so i don't think gala do something wrong.

248. By Viko Adi Rahmawan

fix style

249. By Viko Adi Rahmawan

remove non working key

250. By Viko Adi Rahmawan

little fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Pages/Options/option_handler.vala'
2--- src/Pages/Options/option_handler.vala 2014-10-04 23:25:34 +0000
3+++ src/Pages/Options/option_handler.vala 2014-10-16 16:00:53 +0000
4@@ -12,7 +12,7 @@
5 this.multiple_selection = multiple_selection;
6
7 if (multiple_selection == false) {
8- table.@set (_("None"), "");
9+ table.@set (_("None"), option+":");
10 }
11 }
12
13@@ -59,7 +59,7 @@
14
15 public string? get_code (uint index, uint v) {
16 var item = items.nth (index).data;
17- return item.option + "\t" + item.table.get_values ().nth_data (v);
18+ return item.table.get_values ().nth_data (v);
19 }
20
21 public string get_name (uint index, uint v) {
22@@ -67,22 +67,21 @@
23 }
24
25 public bool from_code (string code, out uint l, out uint v) {
26- var parts = code.split ("\t", 2);
27+ var parts = code.split (":", 2);
28 l = v = 0;
29 if (parts[0] == null || parts[1] == null)
30 return false;
31
32 foreach (var item in items) {
33 v = 0;
34- if (item.option == parts[0]) {
35- foreach (var val in item.table.get_values ()) {
36- if (val == parts[1]) {
37- return true;
38- }
39-
40- v++;
41- }
42+
43+ foreach (var val in item.table.get_values ()) {
44+ if (val == code)
45+ return true;
46+
47+ v++;
48 }
49+
50 l++;
51 }
52
53@@ -200,31 +199,31 @@
54 item.set (_("Make Caps Lock an additional Super"), "caps:super");
55 item.set (_("Make Caps Lock an additional Hyper"), "caps:hyper");
56 item.set (_("Caps Lock toggles Shift so all keys are affected"), "caps:shiftlock");
57- item.set (_("Caps Lock is disabled"), "caps:none");
58 item.set (_("Make Caps Lock an additional Control but keep the Caps_Lock keysym"), "caps:ctrl_modifier");
59 items.append (item);
60
61 item = new Item (_("Alt/Win key behavior"), "altwin", false);
62- item.set (_("Add the standard behavior to Menu key"), "compose:menu");
63- item.set (_("Alt and Meta are on Alt keys"), "compose:meta_alt");
64- item.set (_("Control is mapped to Win keys (and the usual Ctrl keys)"), "compose:ctrl_win");
65- item.set (_("Control is mapped to Alt keys, Alt is mapped to Win keys"), "compose:ctrl_alt_win");
66- item.set (_("Meta is mapped to Win keys"), "compose:meta_win");
67- item.set (_("Meta is mapped to Left Win"), "compose:left_meta_win");
68- item.set (_("Hyper is mapped to Win-keys"), "compose:hyper_win");
69- item.set (_("Alt is mapped to Right Win, Super to Menu"), "compose:alt_super_win");
70- item.set (_("Left Alt is swapped with Left Win"), "compose:swap_lalt_lwin");
71+ item.set (_("Add the standard behavior to Menu key"), "altwin:menu");
72+ item.set (_("Alt and Meta are on Alt keys"), "altwin:meta_alt");
73+ item.set (_("Control is mapped to Win keys (and the usual Ctrl keys)"), "altwin:ctrl_win");
74+ item.set (_("Control is mapped to Alt keys, Alt is mapped to Win keys"), "altwin:ctrl_alt_win");
75+ item.set (_("Meta is mapped to Win keys"), "altwin:meta_win");
76+ item.set (_("Meta is mapped to Left Win"), "altwin:left_meta_win");
77+ item.set (_("Hyper is mapped to Win-keys"), "altwin:hyper_win");
78+ item.set (_("Alt is mapped to Right Win, Super to Menu"), "altwin:alt_super_win");
79+ item.set (_("Alt is mapped to Win keys (and the usual Alt keys)"), "altwin:alt_win");
80+ item.set (_("Alt is swapped with Win"), "altwin:swap_alt_win");
81 items.append (item);
82
83 item = new Item (_("Compose key position"), "Compose key", true);
84 item.set (_("Right Alt"), "compose:ralt");
85- item.set (_("Left Win"), "compose:lwin");
86- item.set (_("Right Win"), "compose:rwin");
87- item.set (_("Menu"), "compose:menu");
88- item.set (_("Left Ctrl"), "compose:lctrl");
89- item.set (_("Right Ctrl"), "compose:rctrl");
90- item.set (_("Caps Lock"), "compose:caps");
91- item.set (_("<Less/Greater>"), "compose:102");
92+ item.set (_("Left Win"), "compose:lwin-altgr");
93+ item.set (_("Right Win"), "compose:rwin-altgr");
94+ item.set (_("Menu"), "compose:menu-altgr");
95+ item.set (_("Left Ctrl"), "compose:lctrl-altgr");
96+ item.set (_("Right Ctrl"), "compose:rctrl-altgr");
97+ item.set (_("Caps Lock"), "compose:caps-altgr");
98+ item.set (_("<Less/Greater>"), "compose:102-altgr");
99 item.set (_("Pause"), "compose:paus");
100 item.set (_("PrtSc"), "compose:prsc");
101 item.set (_("Scroll Lock"), "compose:sclk");
102@@ -255,7 +254,7 @@
103 items.append (item);
104
105 item = new Item (_("Key to choose 5th level"), "lv5", true);
106- item.set (_("<Less/Greater> chooses 5th level, locks when pressed together with another 5th-level-chooser"), "lv5:lalt_switch_lock");
107+ item.set (_("<Less/Greater> chooses 5th level, locks when pressed together with another 5th-level-chooser"), "lv5:lsgt_switch_lock");
108 item.set (_("Right Alt chooses 5th level, locks when pressed together with another 5th-level-chooser"), "lv5:ralt_switch_lock");
109 item.set (_("Left Win chooses 5th level, locks when pressed together with another 5th-level-chooser"), "lv5:lwin_switch_lock");
110 item.set (_("Right Win chooses 5th level, locks when pressed together with another 5th-level-chooser"), "lv5:rwin_switch_lock");
111@@ -272,7 +271,7 @@
112 item.set (_("Non-breakable space character at fourth level, thin non-breakable space character at sixth level (via Ctrl+Shift)"), "nbsp:level4nl");
113 item.set (_("Zero-width non-joiner character at second level"), "nbsp:zwnj2");
114 item.set (_("Zero-width non-joiner character at second level, zero-width joiner character at third level"), "nbsp:zwnj2zwj3");
115- item.set (_("Zero-width non-joiner character at second level, zero-width joiner character at third level, non-breakable space character at fourth level"), "zwnj2zwj3nb4");
116+ item.set (_("Zero-width non-joiner character at second level, zero-width joiner character at third level, non-breakable space character at fourth level"), "nbsp:zwnj2zwj3nb4");
117 item.set (_("Zero-width non-joiner character at second level, non-breakable space character at third level"), "nbsp:zwnj2nb3");
118 item.set (_("Zero-width non-joiner character at second level, non-breakable space character at third level, nothing at fourth level"), "nbsp:zwnj2nb3s");
119 item.set (_("Zero-width non-joiner character at second level, non-breakable space character at third level, zero-width joiner at fourth level"), "nbsp:zwnj2nb3zwj4");
120@@ -289,6 +288,7 @@
121 item = new Item (_("Adding Esperanto circumflexes (supersigno)"), "esperanto", false);
122 item.set (_("To the corresponding key in a Qwerty keyboard"), "esperanto:qwerty");
123 item.set (_("To the corresponding key in a Dvorak keyboard"), "esperanto:dvorak");
124+ item.set (_("To the corresponding key in a Colemak layout"), "esperanto:colemak");
125 items.append (item);
126
127 item = new Item (_("Key sequence to kill the X server"), "terminate", true);
128
129=== modified file 'src/Pages/Options/option_settings.vala'
130--- src/Pages/Options/option_settings.vala 2014-01-06 17:12:27 +0000
131+++ src/Pages/Options/option_settings.vala 2014-10-16 16:00:53 +0000
132@@ -13,7 +13,7 @@
133
134 public OptionSettings()
135 {
136- var schema_name = "org.gnome.libgnomekbd.keyboard";
137+ var schema_name = "org.gnome.desktop.input-sources";
138 var schema_source = GLib.SettingsSchemaSource.get_default ();
139
140 // check if schema exists
141@@ -28,7 +28,7 @@
142 apply ();
143 }
144
145- settings.changed["options"].connect (() => {
146+ settings.changed["xkb-options"].connect (() => {
147 uint[] old_groups = groups;
148 uint[] old_options = options;
149
150@@ -49,7 +49,7 @@
151 // emittedwhen the options are changed from an external program
152 public signal void external_change ();
153
154- // parse the "options" key and store the values in options[] and groups[]
155+ // parse the "xkb-options" key and store the values in options[] and groups[]
156 public bool parse ()
157 {
158 groups = {};
159@@ -57,7 +57,7 @@
160
161 uint group, option;
162
163- foreach (var code in settings.get_strv ("options"))
164+ foreach (var code in settings.get_strv ("xkb-options"))
165 {
166 var add = true;
167
168@@ -86,7 +86,7 @@
169 {
170 groups = {};
171 options = {};
172- settings.set_strv ("options", null);
173+ settings.set_strv ("xkb-options", null);
174 }
175
176
177@@ -99,7 +99,7 @@
178 for (int i = 0; i < groups.length; i++)
179 tmp += option_handler.get_code (groups[i], options[i]);
180
181- settings.set_strv ("options", tmp);
182+ settings.set_strv ("xkb-options", tmp);
183 }
184
185 public void add (uint group, uint option) {

Subscribers

People subscribed via source and target branches