More complex menu schortvuts

2013-06-30 Thread Dominik Vogt
Recently I find it annoying that hotkeys in menus can only be
simple characters because of the menu item syntax, e.g.

  + FvwmConsole ToggleFvwmConsole
^^^

I'd like to extend the hotkey logic so that it also works with
moulti character key names like f1 and possibly sequences like
ctrl-shift-space.  The code to allow this whoould be mostly
there already, so the question of syntax remains.

One option would be to somehow extend the existing syntax to allow
longer key sequences, e.g.

  + FvwmConsole (f1) ...

(resulting in FvwmConsole _f1_), which might break existing
menus.  ANother option might be to add a separate hotkey menu
command, e.g.

 + FvwmConsole (f1) ...
 AddMenuItemHotKey f1

The hotkey would be merged into the previously defined menu item.
I cannot say that either option looks good to me.  Can anybody
think of a cleaner or more natural way to define hotkeys, possibly
recuycling the syntax of the Key command?

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Re: More complex menu schortvuts

2013-06-30 Thread Thomas Adam
On Sun, Jun 30, 2013 at 05:42:51PM +0100, Dominik Vogt wrote:
 Recently I find it annoying that hotkeys in menus can only be
 simple characters because of the menu item syntax, e.g.
 
   + FvwmConsole ToggleFvwmConsole
 ^^^
 
 I'd like to extend the hotkey logic so that it also works with
 moulti character key names like f1 and possibly sequences like
 ctrl-shift-space.  The code to allow this whoould be mostly
 there already, so the question of syntax remains.
 
 One option would be to somehow extend the existing syntax to allow
 longer key sequences, e.g.
 
   + FvwmConsole (f1) ...
 
 (resulting in FvwmConsole _f1_), which might break existing
 menus.  ANother option might be to add a separate hotkey menu
 command, e.g.
 
  + FvwmConsole (f1) ...
  AddMenuItemHotKey f1
 
 The hotkey would be merged into the previously defined menu item.
 I cannot say that either option looks good to me.  Can anybody
 think of a cleaner or more natural way to define hotkeys, possibly
 recuycling the syntax of the Key command?

Another idea might be to simply allow keys when a menu is open to act like
a typeahead search; the more keys you press, the closer to match you get,
and at each stage, matched items are highlighted in the menu, etc.

-- Thomas Adam

-- 
Deep in my heart I wish I was wrong.  But deep in my heart I know I am
not. -- Morrissey (Girl Least Likely To -- off of Viva Hate.)



Re: More complex menu schortvuts

2013-06-30 Thread Dan Espen
Dominik Vogt dominik.v...@gmx.de writes:

 Recently I find it annoying that hotkeys in menus can only be
 simple characters because of the menu item syntax, e.g.

   + FvwmConsole ToggleFvwmConsole
 ^^^

 I'd like to extend the hotkey logic so that it also works with
 moulti character key names like f1 and possibly sequences like
 ctrl-shift-space.  The code to allow this whoould be mostly
 there already, so the question of syntax remains.

 One option would be to somehow extend the existing syntax to allow
 longer key sequences, e.g.

   + FvwmConsole (f1) ...

 (resulting in FvwmConsole _f1_), which might break existing
 menus.  ANother option might be to add a separate hotkey menu
 command, e.g.

Seems to me like the above is the simplest and most intuitive solution.
I doubt we have a lot of existing menus using ( as a short cut.
It's not real easy to use a shifted key as a shortcut key.

-- 
Dan Espen



Re: More complex menu schortvuts

2013-06-30 Thread Dan Espen
Thomas Adam tho...@fvwm.org writes:

 On Sun, Jun 30, 2013 at 05:42:51PM +0100, Dominik Vogt wrote:
 Recently I find it annoying that hotkeys in menus can only be
 simple characters because of the menu item syntax, e.g.
 
   + FvwmConsole ToggleFvwmConsole
 ^^^
 
 I'd like to extend the hotkey logic so that it also works with
 moulti character key names like f1 and possibly sequences like
 ctrl-shift-space.  The code to allow this whoould be mostly
 there already, so the question of syntax remains.
 
 One option would be to somehow extend the existing syntax to allow
 longer key sequences, e.g.
 
   + FvwmConsole (f1) ...
 
 (resulting in FvwmConsole _f1_), which might break existing
 menus.  ANother option might be to add a separate hotkey menu
 command, e.g.
 
  + FvwmConsole (f1) ...
  AddMenuItemHotKey f1
 
 The hotkey would be merged into the previously defined menu item.
 I cannot say that either option looks good to me.  Can anybody
 think of a cleaner or more natural way to define hotkeys, possibly
 recuycling the syntax of the Key command?

 Another idea might be to simply allow keys when a menu is open to act like
 a typeahead search; the more keys you press, the closer to match you get,
 and at each stage, matched items are highlighted in the menu, etc.

Aggh. no!

Actually lots of my menus are heavily short-cutted.
I'd don't think I'd get very far in a search term before one the options
would be selected.
Even a menu without short cuts accepts vi-keys for cursor movement.


-- 
Dan Espen



Re: More complex menu schortvuts

2013-06-30 Thread Dominik Vogt
On Sun, Jun 30, 2013 at 05:53:39PM +0100, Thomas Adam wrote:
 Another idea might be to simply allow keys when a menu is open to act like
 a typeahead search; the more keys you press, the closer to match you get,
 and at each stage, matched items are highlighted in the menu, etc.

Actually, what I have in mind is page switching.  Consoles can be
switched with Alt-Fn.  I've configured the same in fvwm.  On my
3x2 desktop, the top three pages are selected with Alt-F1/2/3 and
the bottom three pages are selected with Alt-1/2/3.  I also have
menu items Put on page (0/1 0/1/2) in the window menu, and I'd
like to also use the keys F1/2/3 and 1/2/3 to move the window to
the corresponding page.  At the moment this is not possible.

In other words: A typeahead search wouldn't solve this problem.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



Re: More complex menu schortvuts

2013-06-30 Thread Tapio Luukkanen


  
  
Hello,

On 30/06/13 20:31, Dominik Vogt wrote:

  Actually, what I have in mind is page switching.  Consoles can be
switched with Alt-Fn.  I've configured the same in fvwm.  On my
3x2 desktop, the top three pages are selected with Alt-F1/2/3 and
the bottom three pages are selected with Alt-1/2/3.  I also have
menu items "Put on page (0/1 0/1/2)" in the window menu, and I'd
like to also use the keys F1/2/3 and 1/2/3 to move the window to
the corresponding page.  At the moment this is not possible


With the common pc-104 or pc-105 keyvoard It seems natural
to page switch and move windows on 3x2 desktops like this:

#--
# Navigate to a different page.
Key Insert A CMS GoToPage 0 0
Key Home A CMS GoToPage 1 0
Key Prior A CMS GoToPage 2 0
Key Delete A CMS GoToPage 0 1
Key End A CMS GoToPage 1 1
Key Next A CMS GoToPage 2 1 
#--
# Move window to a different page.
Key Insert A CMS4 MoveToPage 0 0
Key Home A CMS4 MoveToPage 1 0
Key Prior A CMS4 MoveToPage 2 0
Key Delete A CMS4 MoveToPage 0 1
Key End A CMS4 MoveToPage 1 1
Key Next A CMS4 MoveToPage 2 1

I've been using xmodmap to map MOD4 to the "Windows" key
for a long time.

--Tapio

  




Re: More complex menu schortvuts

2013-06-30 Thread Thomas Funk

Dan Espen wrote:
 Dominik Vogt dominik.v...@gmx.de writes:

 Recently I find it annoying that hotkeys in menus can only be
 simple characters because of the menu item syntax, e.g.

   + FvwmConsole ToggleFvwmConsole
 ^^^

 I'd like to extend the hotkey logic so that it also works with
 moulti character key names like f1 and possibly sequences like
 ctrl-shift-space.  The code to allow this whoould be mostly
 there already, so the question of syntax remains.

 One option would be to somehow extend the existing syntax to allow
 longer key sequences, e.g.

   + FvwmConsole (f1) ...

 (resulting in FvwmConsole _f1_), which might break existing
 menus.  ANother option might be to add a separate hotkey menu
 command, e.g.

 Seems to me like the above is the simplest and most intuitive solution.
 I doubt we have a lot of existing menus using ( as a short cut.
 It's not real easy to use a shifted key as a shortcut key.

What about

   + FvwmConsole §{f1} ...

Or is '§' used anywhere in the menu syntax? I think not but I am not sure.
Also the curly brackets looks more intuitively than parentheses (for me).

Thomas