satya
unread,Oct 21, 2008, 6:27:46 PM10/21/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to leo-editor
Hi,
I am just getting started on learning Leo.
I have a keyboard with a real Meta key on a Linux system. I have bound
a lot of window-manager functions to the Alt key. Leo seemed to have
only the ability to support Alt, but not Meta. I naiively added Meta
wherever Alt was mentioned in leoKeys.py (patch attached). The result
seems to work. Please see if this is something you would like to
include in the official version.
Thanks,
Satya
=== modified file 'leo/core/leoKeys.py'
--- leo/core/leoKeys.py 2008-10-05 02:37:18 +0000
+++ leo/core/leoKeys.py 2008-10-21 22:02:34 +0000
@@ -2455,6 +2455,7 @@
#@+node:ekr.20061031131434.106:<< define specialKeysyms >>
specialKeysyms = (
'Alt_L','Alt_R',
+ 'Meta_L','Meta_R',
'Caps_Lock','Control_L','Control_R',
'Num_Lock',
'Shift_L','Shift_R',
@@ -2859,6 +2860,7 @@
sep = '-' * n1
for prefix in (
'Alt+Ctrl+Shift', 'Alt+Shift', 'Alt+Ctrl', 'Alt
+Key','Alt',
+ 'Meta+Ctrl+Shift', 'Meta+Shift', 'Meta+Ctrl', 'Meta
+Key','Meta',
'Ctrl+Shift', 'Ctrl', 'Shift',
):
data2 = []
@@ -3267,6 +3269,7 @@
special_keys = (
'Alt_L','Alt_R',
+ 'Meta_L','Meta_R',
'Caps_Lock','Control_L','Control_R',
'Num_Lock',
'Shift_L','Shift_R',
@@ -4394,7 +4397,7 @@
k = self ; shortcut = shortcut or ''
- for s in ('Alt','Ctrl','Command'):
+ for s in ('Alt','Ctrl','Command', 'Meta'):
if shortcut.find(s) != -1:
return False
else:
@@ -4428,6 +4431,7 @@
cmd = s2.find("cmd") >= 0 or s2.find("command") >= 0
ctrl = s2.find("control") >= 0 or s2.find("ctrl") >= 0
alt = s2.find("alt") >= 0
+ meta = s2.find("meta") >= 0
shift = s2.find("shift") >= 0 or s2.find("shft") >= 0
#@-node:ekr.20061031131434.185:<< define cmd, ctrl, alt,
shift >>
#@nl
@@ -4487,6 +4491,7 @@
#@+node:ekr.20061031131434.189:<< compute shortcut >>
table = (
(alt, 'Alt+'),
+ (meta, 'Meta+'),
(ctrl,'Ctrl+'),
(cmd, 'Command+'),
(shift,'Shift+'),
@@ -4512,6 +4517,7 @@
for a,b in (
('Alt+','Alt-'),
+ ('Meta+','Meta-'),
('Ctrl-','Control-'),
('Ctrl+','Control-'), # New in Leo 4.5.
('Shift+','Shift-'),
@@ -4826,6 +4832,7 @@
k.updateLabel(event)
elif stroke == '<Key>' and keysym in (
'Alt_L','Alt_R',
+ 'Meta_L','Meta_R',
'Control_L','Control_R',
'Shift_L','Shift_R',
):