[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-user: [pcb.lesstif] multi-key hotkeys



The project I was *going* to work on today (but never got to during
the sprint) was to add multi-key hotkeys to pcb, much like what gschem
has.  Well, it's in, for the lesstif HID at least.  I didn't change the menu
definitions, so it won't *use* any multi-key hotkeys yet, but if you want
to add them, the syntax is like this:

   Modifier<Keys>abc

It's just like the existing accelerators already in pcb-menu.res, but
note "Keys" instead of "Key" so that pcb can tell the difference
between "<Key>F1" which is a function key, and "<Keys>F1" which is the
F key (upper case) followed by the 1 key.  Single-key hotkeys can use
<Key> or <Keys>.

Example:

    {  "0.1 mil" checked=gridsize,10 SetUnits(mil) SetValue(Grid,10) a={"G 10" "<Keys>g10"}}
    {  "1 mil"   checked=gridsize,100 SetUnits(mil) SetValue(Grid,100) a={"G 15" "<Keys>g15"}}
    {  "5 mil"   checked=gridsize,500 SetUnits(mil) SetValue(Grid,500) a={"G 3" "<Keys>g3"}}
    { "10 mil"   checked=gridsize,1000 SetUnits(mil) SetValue(Grid,1000) a={"G 4" "<Keys>g4"}}
    { "25 mil"   checked=gridsize,2500 SetUnits(mil) SetValue(Grid,2500) a={"G 5" "<Keys>g5"}}
    {"100 mil"   checked=gridsize,10000 SetUnits(mil) SetValue(Grid,10000) a={"G 6" "<Keys>g6"}}
    -
    {"Grid -5mil" SetValue(Grid,-5,mil) a={"G-" "Ctrl<Keys>g-"}}
    {"Grid +5mil" SetValue(Grid,+5,mil) a={"G+" "<Keys>g+"}}
    {"Grid -0.05mm" SetValue(Grid,-0.05,mm) a={"Shift-Ctrl-G" "Shift Ctrl<Key>g"}}
    {"Grid +0.05mm" SetValue(Grid,+0.05,mm) a={"Ctrl-G" "Ctrl<Key>g"}}

Note that, like gschem, it's not limited to two keys.  However, it is
limited to keys that represent vanilla ASCII characters - thus, the
Tab key can't be part of a multi-key hotkey.

So now if you want a set of key bindings and menus that's just like
gschem, you can wipe your pcb-menu.res and write a new one from
scratch to do so!

Enjoy!


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user