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.
- 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',
):
On Tue, Oct 21, 2008 at 5:27 PM, satya <quf...@gmail.com> wrote: > only the ability to support Alt, but not Meta. I naively 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 for this. Yes, I'll add it soon.
BTW, I often use the "naive" approach you used. Many times it works without "true" understanding of the code. For example, much (not all!) of the qt plugin work involves running code and fixing whatever crashes show up :-)
On Oct 22, 8:04 am, "Edward K. Ream" <edream...@gmail.com> wrote:
> On Tue, Oct 21, 2008 at 5:27 PM, satya <quf...@gmail.com> wrote:
> > only the ability to support Alt, but not Meta. I naively 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 for this. Yes, I'll add it soon
Your patches are on the trunk at rev 1230. All unit tests pass, but I
manually patched the code. Feel free to make any changes/corrections
to the trunk using bzr.
On Oct 22, 7:26 am, "Edward K. Ream" <edream...@gmail.com> wrote:
> On Oct 22, 8:04 am, "Edward K. Ream" <edream...@gmail.com> wrote:
> > On Tue, Oct 21, 2008 at 5:27 PM, satya <quf...@gmail.com> wrote:
> > > only the ability to support Alt, but not Meta. I naively 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 for this. Yes, I'll add it soon
> Your patches are on the trunk at rev 1230. All unit tests pass, but I
> manually patched the code. Feel free to make any changes/corrections
> to the trunk using bzr.
Edward,
Thank you for lightning speed support.
I am still rather new to bzr, so didn't feel comfortable pushing it
that way. If I find anything else that I want, I'll be sure to check
into that.