Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Meta key support
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
satya  
View profile  
 More options Oct 21 2008, 6:27 pm
From: satya <quf...@gmail.com>
Date: Tue, 21 Oct 2008 15:27:46 -0700 (PDT)
Local: Tues, Oct 21 2008 6:27 pm
Subject: Meta key support
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',
             ):


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward K. Ream  
View profile  
 More options Oct 22 2008, 9:04 am
From: "Edward K. Ream" <edream...@gmail.com>
Date: Wed, 22 Oct 2008 08:04:01 -0500
Local: Wed, Oct 22 2008 9:04 am
Subject: Re: Meta key support

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 :-)

Edward


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward K. Ream  
View profile  
 More options Oct 22 2008, 9:26 am
From: "Edward K. Ream" <edream...@gmail.com>
Date: Wed, 22 Oct 2008 06:26:08 -0700 (PDT)
Local: Wed, Oct 22 2008 9:26 am
Subject: Re: Meta key support
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
satya  
View profile  
 More options Oct 22 2008, 11:29 am
From: satya <quf...@gmail.com>
Date: Wed, 22 Oct 2008 08:29:34 -0700 (PDT)
Local: Wed, Oct 22 2008 11:29 am
Subject: Re: Meta key support
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.

Satya


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edward K. Ream  
View profile  
 More options Oct 22 2008, 11:38 am
From: "Edward K. Ream" <edream...@gmail.com>
Date: Wed, 22 Oct 2008 10:38:47 -0500
Local: Wed, Oct 22 2008 11:38 am
Subject: Re: Meta key support

On Wed, Oct 22, 2008 at 10:29 AM, satya <quf...@gmail.com> wrote:
> Thank you for lightning speed support.

Patches always get my attention.

Edward


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google