Re: KeyConfig, KeyBinding and other related issues.

Terry Reedy <[email protected]>
Newsgroups gmane.comp.python.idle
Message-ID <[email protected]>
On 6/13/2014 7:45 AM, Saimadhav Heblikar wrote:
> On 13 June 2014 16:58, Tal Einat <[email protected]> wrote:
>> On Fri, Jun 13, 2014 at 2:22 PM, Saimadhav Heblikar
>> <[email protected]> wrote:
>>> Just a heads up to both: I am writing a keyseq validator method.
>>> It currently works for over 800 permutations of ['Shift', 'Control',
>>> 'Alt', 'Meta', 'Key-a', 'Key-A', 'Up', 'Key-Up', 'a', 'A']. It works
>>> for permutations of length 2 and 3. Beyond that its not worth it IMO.
>>> I am currently trying to integrate it with test_configuration.py and
>>> catching permutations i missed out.

We do not need 'permutations', as least not for validating in canonical 
form. Basic mode produces Control? Alt? Shift? in that order.  The regex 
for that is trivial. If Tk accepts in *any* order, the regex is only 
slightly more complicated.

>>> I post this, so that we dont duplicate work. I hope it to be ready by
>>> the end of the day.(UTC +5.5)
>>
>> What is the method you are using?
>
> Regex. It is not something elegant. The permutations are coded in.(Not
> all 800+ obviously, but around 15-20 general ones.).

Whether specific combination (unordered) and permutation (ordered) must 
be coded in depends of the grammer Tk uses. See comment on next post.

> The only advantage is it can be used without creating a new Tk instance.

I am not sure I get this.


-- 
Terry Jan Reedy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.