lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] "Ctrl-+" keyboard accelerator


From: Vadim Zeitlin
Subject: Re: [lmi] "Ctrl-+" keyboard accelerator
Date: Wed, 27 Jan 2021 17:52:40 +0100

On Wed, 27 Jan 2021 14:49:09 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:

GC> On lmi's "Census" menu:
GC>   Add cell   Ctrl-+
GC> ...exactly what does "Ctrl-+" mean? There are three reasonable 
interpretations:
GC>   (1) holding down Ctrl, press the key labelled "+" over "="
GC>   (2) holding down Ctrl and Shift, press the key labelled "+" over "="
GC>         because Shift normally chooses between "=" and "+"
GC>   (3) holding down Ctr, press the "gray" numeric-keypad "+" key
GC> Today's actual lmi behavior:
GC>   (1) performs "Add cell", but (2) and (3) don't
GC> Desired behavior:
GC>   (1), (2), and (3) all perform "Add cell"
GC> [Cf. firefox, where all three do the same thing.]
GC> 
GC> Vadim--how can this be accomplished in lmi?

 In wx the 3 scenarios correspond to 3 different accelerators:

(1) Ctrl-+
(2) Shift-Ctrl-+
(3) Ctrl-Num +

but only a single accelerator can be encoded in the menu label.

 So without changing this in wx the only way to achieve what you want is by
using wxAcceleratorTable with accelerators corresponding to (2) and (3) and
using the same ID as the menu item, i.e. XRCID("add_cell"). Unfortunately
this would need to be done in the code, i.e. it can't be done in XRC
itself.

 It shouldn't be very difficult (but not completely trivial neither, I'm
afraid) to add support for some <extra-accels> child of <menuitem> element
in XRC allowing to use something like

    <object class="wxMenuItem" name="add_cell">
        <label>_Add cell\tCtrl-+</label>
        <extra-accels>
            <accel>Shift-Ctrl-+</accel>
            <accel>Ctrl-Num +</accel>
        </extra-accels>
        ...
    </object>

but this would require modifying wx, of course, and I'm not sure if you
want to do this.

 Please let me know if you do or if you'd like me to make a patch using
wxAcceleratorTable to lmi (which I rather dislike because it seems ugly to
define a menu item half in XRC and half in the code, but it's still the
simplest way to actually make this work).

 Thanks,
VZ

Attachment: pgpIzTRYy95wQ.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]