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 @@
[EMAIL PROTECTED]: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
[EMAIL PROTECTED]:ekr.20061031131434.185:<< define cmd, ctrl, alt,
shift >>
[EMAIL PROTECTED]
@@ -4487,6 +4491,7 @@
[EMAIL PROTECTED]: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',
):
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---