Manage copy/paste on darwin

The control mask on darwin for copy/paste should be MOD2 instead of CONTROL.

issue5022
review18671002
This commit is contained in:
Cédric Krier committed 2015-11-03 12:15:01 +01:00
1 parent 7b91ab8575
commit ed7ce05f1e
2 files changed
+7 -2

No files matched your search

+2
View File
@@ -1,3 +1,5 @@
* Use Apple key for copy/past of list
Version 3.8.0 - 2015-11-02
* Bug fixes (see mercurial logs for details)
* Use italic labels for editable fields
+5 -2
View File
@@ -637,12 +637,15 @@ class ViewTree(View):
if isinstance(b.renderer, CellRendererButton)]
def on_keypress(self, widget, event):
control_mask = gtk.gdk.CONTROL_MASK
if sys.platform == 'darwin':
control_mask = gtk.gdk.MOD2_MASK
if (event.keyval == gtk.keysyms.c
and event.state & gtk.gdk.CONTROL_MASK):
and event.state & control_mask):
self.on_copy()
return False
if (event.keyval == gtk.keysyms.v
and event.state & gtk.gdk.CONTROL_MASK):
and event.state & control_mask):
self.on_paste()
return False