Make "old esc mode" key timeout configurable

Denis Vlasenko vda.linux at googlemail.com
Mon Aug 7 11:06:27 UTC 2006


Hi Leonard,

Please CC me directly (use "Reply to all").
I read a lot of mailing lists. Mails which are not addressed
explicitly to me are often overlooked/lost.

On Tuesday 01 August 2006 23:22, Leonard den Ottolander wrote:
> > diff -urp mc-4.6.0.orig/src/key.c mc-4.6.0/src/key.c
> 
> > -#define ESCMODE_TIMEOUT 1000000
> > +#define ESCMODE_TIMEOUT keyboard_key_timeout
> 
> Why do you keep this define around if it is substituted for a global
> variable? Just get rid of that define and substitute it with the
> variable.

ok

> > +    char *kt = (char *)getenv("KEYBOARD_KEY_TIMEOUT_US");
> 
> Please conform to the used coding style. I agree the extra spaces are
> ugly but its even uglier mixing styles.
> 
> > +    if (kt != NULL)
> > +       keyboard_key_timeout = atoi(kt);

ok

> What about a multiplier (1000) so the environment variable is in ms? And

Why? I want to accomodate even those mad people who insist on,
say, 500 microsecond delay. There is no downside in doing it.

> should there be a sanity check here for invalid input (= 0) and/or too
> small (10ms?) and too large (10s?) values?

No. 0 and 10 seconds are not invalid.

0 means that ESC will immediately be taken as a separate key,
even if the rest of key sequence will be received with no delay.
Not very useful? Maybe.

10 seconds means that you will need to wait 10 seconds for single ESC
to be considered separate key. Silly? Well, for me, even old
default of 1 second delay was too big. So it varies from
person to person.

Updated patch is attached. Please apply.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: key_timeout.diff
Type: text/x-diff
Size: 2056 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20060807/92d98bce/attachment.diff>


More information about the mc-devel mailing list