[Idle-dev] KeyConfig, KeyBinding and other related issues.
Terry Reedy
tjreedy at udel.edu
Fri Jun 13 18:39:41 CEST 2014
On 6/13/2014 7:45 AM, Saimadhav Heblikar wrote:
> On 13 June 2014 16:58, Tal Einat <taleinat at gmail.com> wrote:
>> On Fri, Jun 13, 2014 at 2:22 PM, Saimadhav Heblikar
>> <saimadhavheblikar at gmail.com> 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
More information about the IDLE-dev
mailing list