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
1=== modified file 'Screenkey/listenkbd.py'
2--- Screenkey/listenkbd.py 2011-02-27 18:32:01 +0000
3+++ Screenkey/listenkbd.py 2012-02-08 12:26:18 +0000
4@@ -3,12 +3,12 @@
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8-#
9+#
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14-#
15+#
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19@@ -31,18 +31,18 @@
20 'XK_Return':u'\u23CE ',
21 'XK_Space':u' ',
22 'XK_Caps_Lock':_('Caps '),
23- 'XK_F1':u'F1 ',
24- 'XK_F2':u'F2 ',
25- 'XK_F3':u'F3 ',
26- 'XK_F4':u'F4 ',
27- 'XK_F5':u'F5 ',
28- 'XK_F6':u'F6 ',
29- 'XK_F7':u'F7 ',
30- 'XK_F8':u'F8 ',
31- 'XK_F9':u'F9 ',
32- 'XK_F10':u'F10 ',
33- 'XK_F11':u'F11 ',
34- 'XK_F12':u'F12 ',
35+ 'XK_F1':u'F1 ',
36+ 'XK_F2':u'F2 ',
37+ 'XK_F3':u'F3 ',
38+ 'XK_F4':u'F4 ',
39+ 'XK_F5':u'F5 ',
40+ 'XK_F6':u'F6 ',
41+ 'XK_F7':u'F7 ',
42+ 'XK_F8':u'F8 ',
43+ 'XK_F9':u'F9 ',
44+ 'XK_F10':u'F10 ',
45+ 'XK_F11':u'F11 ',
46+ 'XK_F12':u'F12 ',
47 'XK_Home':_('Home '),
48 'XK_Up':u'\u2191',
49 'XK_Page_Up':_('PgUp '),
50@@ -53,7 +53,7 @@
51 'XK_Next':_('PgDn '),
52 'XK_Insert':_('Ins '),
53 'XK_Delete':_('Del '),
54- 'XK_KP_Home':u'(7) ',
55+ 'XK_KP_Home':u'(7)',
56 'XK_KP_Up':u'(8)',
57 'XK_KP_Prior':u'(9)',
58 'XK_KP_Left':u'(4)',
59@@ -61,6 +61,15 @@
60 'XK_KP_End':u'(1)',
61 'XK_KP_Down':u'(2)',
62 'XK_KP_Page_Down':u'(3)',
63+ 'XK_KP_Begin':u'(5)',
64+ 'XK_KP_Insert':u'(0)',
65+ 'XK_KP_Delete':u'(.)',
66+ 'XK_KP_Add':u'(+)',
67+ 'XK_KP_Subtract':u'(-)',
68+ 'XK_KP_Multiply':u'(*)',
69+ 'XK_KP_Divide':u'(/)',
70+ 'XK_Num_Lock':u'NumLock ',
71+ 'XK_KP_Enter':u'\u23CE ',
72 }
73
74 class ListenKbd(threading.Thread):
75@@ -132,13 +141,13 @@
76 else:
77 self.label.set_text("")
78 self.label.emit("text-changed")
79-
80+
81 def key_press(self, reply):
82
83 # FIXME:
84 # This is not the most efficient way to detect the
85 # use of sudo/gksudo but it works.
86- sudo_is_running = subprocess.call(['ps', '-C', 'sudo'],
87+ sudo_is_running = subprocess.call(['ps', '-C', 'sudo'],
88 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
89 if not sudo_is_running:
90 return
91@@ -156,7 +165,7 @@
92 data = reply.data
93 key = None
94 while len(data):
95- event, data = rq.EventField(None).parse_binary_value(data,
96+ event, data = rq.EventField(None).parse_binary_value(data,
97 self.record_dpy.display, None, None)
98 if event.type in [X.KeyPress, X.KeyRelease]:
99 if self.mode == MODE_NORMAL:
100@@ -175,9 +184,9 @@
101 if event.detail in self.keymap:
102 key_normal, key_shift, key_dead, key_deadshift = \
103 self.keymap[event.detail]
104- self.logger.debug("Key %s(keycode) %s. Symbols %s" %
105- (event.detail,
106- event.type == X.KeyPress and "pressed" or "released",
107+ self.logger.debug("Key %s(keycode) %s. Symbols %s" %
108+ (event.detail,
109+ event.type == X.KeyPress and "pressed" or "released",
110 self.keymap[event.detail])
111 )
112 else:
113@@ -192,7 +201,7 @@
114 else:
115 self.cmd_keys['alt'] = False
116 return
117- # Meta key
118+ # Meta key
119 # Fixme: it must use self.modifiers['mod5']
120 # but doesn't work
121 if event.detail == 108:
122@@ -201,7 +210,7 @@
123 else:
124 self.cmd_keys['meta'] = False
125 return
126- # Super key
127+ # Super key
128 if event.detail in self.modifiers['mod4']:
129 if event.type == X.KeyPress:
130 self.cmd_keys['super'] = True

Subscribers

People subscribed via source and target branches

to all changes: