Merge lp:~iammuneeb/screenkey/numpad-5 into lp:screenkey

Proposed by Muneeb Shaikh
Status: Merged
Approved by: Pablo SEMINARIO
Approved revision: 52
Merged at revision: 49
Proposed branch: lp:~iammuneeb/screenkey/numpad-5
Merge into: lp:screenkey
Diff against target: 130 lines (+32/-23)
1 file modified
Screenkey/listenkbd.py (+32/-23)
To merge this branch: bzr merge lp:~iammuneeb/screenkey/numpad-5
Reviewer Review Type Date Requested Status
Pablo SEMINARIO Approve
Review via email: mp+91940@code.launchpad.net

Description of the change

Fix for numpad key 5. Removed trailing whitespaces. Removed trailing space after numpad key 7.

To post a comment you must log in.
lp:~iammuneeb/screenkey/numpad-5 updated
52. By Muneeb Shaikh

added missing keys on numpad

Revision history for this message
Pablo SEMINARIO (pabluk) wrote :

Thanks for the fixes Muneeb

review: Approve
Revision history for this message
Muneeb Shaikh (iammuneeb) wrote :

@Pablo
I had also added remaining missing keys on numpad such as Enter key, +, -, *, / etc, but I didn't notice them before submitting the patch. I had added them to my branch but I couldn't propose merge as LP told me that there's already a merge request. You can take a diff and apply or I'll send the merge later.

Revision history for this message
Pablo SEMINARIO (pabluk) wrote :

@Muneeb

I merged the latest changes from your branch. If there are new changes to add from your branch can you please propose a new merge.

Thanks!

Revision history for this message
Muneeb Shaikh (iammuneeb) wrote :

@Pablo

You have added all the changes which I had made. If I make any changes I'll request new merge.

PS: I'm new to bzr and LP, and I was confused about sending two merge request one after the other, but LP took the latest changes as well, so I didn't need to make second merge request.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Screenkey/listenkbd.py'
--- Screenkey/listenkbd.py 2011-02-27 18:32:01 +0000
+++ Screenkey/listenkbd.py 2012-02-08 12:26:18 +0000
@@ -3,12 +3,12 @@
3# it under the terms of the GNU General Public License as published by3# it under the terms of the GNU General Public License as published by
4# the Free Software Foundation, either version 3 of the License, or4# the Free Software Foundation, either version 3 of the License, or
5# (at your option) any later version.5# (at your option) any later version.
6# 6#
7# This program is distributed in the hope that it will be useful,7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10# GNU General Public License for more details.10# GNU General Public License for more details.
11# 11#
12# You should have received a copy of the GNU General Public License12# You should have received a copy of the GNU General Public License
13# along with this program. If not, see <http://www.gnu.org/licenses/>.13# along with this program. If not, see <http://www.gnu.org/licenses/>.
1414
@@ -31,18 +31,18 @@
31 'XK_Return':u'\u23CE ',31 'XK_Return':u'\u23CE ',
32 'XK_Space':u' ',32 'XK_Space':u' ',
33 'XK_Caps_Lock':_('Caps '),33 'XK_Caps_Lock':_('Caps '),
34 'XK_F1':u'F1 ', 34 'XK_F1':u'F1 ',
35 'XK_F2':u'F2 ', 35 'XK_F2':u'F2 ',
36 'XK_F3':u'F3 ', 36 'XK_F3':u'F3 ',
37 'XK_F4':u'F4 ', 37 'XK_F4':u'F4 ',
38 'XK_F5':u'F5 ', 38 'XK_F5':u'F5 ',
39 'XK_F6':u'F6 ', 39 'XK_F6':u'F6 ',
40 'XK_F7':u'F7 ', 40 'XK_F7':u'F7 ',
41 'XK_F8':u'F8 ', 41 'XK_F8':u'F8 ',
42 'XK_F9':u'F9 ', 42 'XK_F9':u'F9 ',
43 'XK_F10':u'F10 ', 43 'XK_F10':u'F10 ',
44 'XK_F11':u'F11 ', 44 'XK_F11':u'F11 ',
45 'XK_F12':u'F12 ', 45 'XK_F12':u'F12 ',
46 'XK_Home':_('Home '),46 'XK_Home':_('Home '),
47 'XK_Up':u'\u2191',47 'XK_Up':u'\u2191',
48 'XK_Page_Up':_('PgUp '),48 'XK_Page_Up':_('PgUp '),
@@ -53,7 +53,7 @@
53 'XK_Next':_('PgDn '),53 'XK_Next':_('PgDn '),
54 'XK_Insert':_('Ins '),54 'XK_Insert':_('Ins '),
55 'XK_Delete':_('Del '),55 'XK_Delete':_('Del '),
56 'XK_KP_Home':u'(7) ',56 'XK_KP_Home':u'(7)',
57 'XK_KP_Up':u'(8)',57 'XK_KP_Up':u'(8)',
58 'XK_KP_Prior':u'(9)',58 'XK_KP_Prior':u'(9)',
59 'XK_KP_Left':u'(4)',59 'XK_KP_Left':u'(4)',
@@ -61,6 +61,15 @@
61 'XK_KP_End':u'(1)',61 'XK_KP_End':u'(1)',
62 'XK_KP_Down':u'(2)',62 'XK_KP_Down':u'(2)',
63 'XK_KP_Page_Down':u'(3)',63 'XK_KP_Page_Down':u'(3)',
64 'XK_KP_Begin':u'(5)',
65 'XK_KP_Insert':u'(0)',
66 'XK_KP_Delete':u'(.)',
67 'XK_KP_Add':u'(+)',
68 'XK_KP_Subtract':u'(-)',
69 'XK_KP_Multiply':u'(*)',
70 'XK_KP_Divide':u'(/)',
71 'XK_Num_Lock':u'NumLock ',
72 'XK_KP_Enter':u'\u23CE ',
64}73}
6574
66class ListenKbd(threading.Thread):75class ListenKbd(threading.Thread):
@@ -132,13 +141,13 @@
132 else:141 else:
133 self.label.set_text("")142 self.label.set_text("")
134 self.label.emit("text-changed")143 self.label.emit("text-changed")
135 144
136 def key_press(self, reply):145 def key_press(self, reply):
137146
138 # FIXME:147 # FIXME:
139 # This is not the most efficient way to detect the148 # This is not the most efficient way to detect the
140 # use of sudo/gksudo but it works.149 # use of sudo/gksudo but it works.
141 sudo_is_running = subprocess.call(['ps', '-C', 'sudo'], 150 sudo_is_running = subprocess.call(['ps', '-C', 'sudo'],
142 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)151 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
143 if not sudo_is_running:152 if not sudo_is_running:
144 return153 return
@@ -156,7 +165,7 @@
156 data = reply.data165 data = reply.data
157 key = None166 key = None
158 while len(data):167 while len(data):
159 event, data = rq.EventField(None).parse_binary_value(data, 168 event, data = rq.EventField(None).parse_binary_value(data,
160 self.record_dpy.display, None, None)169 self.record_dpy.display, None, None)
161 if event.type in [X.KeyPress, X.KeyRelease]:170 if event.type in [X.KeyPress, X.KeyRelease]:
162 if self.mode == MODE_NORMAL:171 if self.mode == MODE_NORMAL:
@@ -175,9 +184,9 @@
175 if event.detail in self.keymap:184 if event.detail in self.keymap:
176 key_normal, key_shift, key_dead, key_deadshift = \185 key_normal, key_shift, key_dead, key_deadshift = \
177 self.keymap[event.detail]186 self.keymap[event.detail]
178 self.logger.debug("Key %s(keycode) %s. Symbols %s" % 187 self.logger.debug("Key %s(keycode) %s. Symbols %s" %
179 (event.detail, 188 (event.detail,
180 event.type == X.KeyPress and "pressed" or "released", 189 event.type == X.KeyPress and "pressed" or "released",
181 self.keymap[event.detail])190 self.keymap[event.detail])
182 )191 )
183 else:192 else:
@@ -192,7 +201,7 @@
192 else:201 else:
193 self.cmd_keys['alt'] = False202 self.cmd_keys['alt'] = False
194 return203 return
195 # Meta key 204 # Meta key
196 # Fixme: it must use self.modifiers['mod5']205 # Fixme: it must use self.modifiers['mod5']
197 # but doesn't work206 # but doesn't work
198 if event.detail == 108:207 if event.detail == 108:
@@ -201,7 +210,7 @@
201 else:210 else:
202 self.cmd_keys['meta'] = False211 self.cmd_keys['meta'] = False
203 return212 return
204 # Super key 213 # Super key
205 if event.detail in self.modifiers['mod4']:214 if event.detail in self.modifiers['mod4']:
206 if event.type == X.KeyPress:215 if event.type == X.KeyPress:
207 self.cmd_keys['super'] = True216 self.cmd_keys['super'] = True

Subscribers

People subscribed via source and target branches

to all changes: