Re: FVWM: Bind key sequences

2012-04-30 Thread Andre Majorel
On 2012-04-29 21:50 +0100, Thomas Adam wrote:
 On Sun, Apr 29, 2012 at 10:35:45PM +0200, Andre Majorel wrote:
  Note how KP_Home must be used, even though the actual event is
  KP_7. There may be a simpler way but I've had enough for
  tonight.
 
 No, there isn't.  It's two different keysyms, depending on whether Numlock
 is used.  That's expected.

What I found counter-intuitive was having to bind KP_Home even
when num-lock is on.

What would you recommend to bind [pause][pause] to [pause] ?
(I.e. to get a literal hot key, press it twice.) This does not
work :

DestroyFunc pause_numlk_off
AddToFunc   pause_numlk_off
+ I Echo pause_numlk_off
+ I Key KP_Home A N GotoPage 0 0
+ I Key Pause   A N pause_pass
#+ I Schedule 1000 Key KP_Home A N -
#+ I Schedule 1000 Key Pause   A N -
Key Pause A N pause_numlk_off

DestroyFunc pause_numlk_on
AddToFunc   pause_numlk_on
+ I Echo pause_numlk_on
+ I Key KP_Home A 2 GotoPage 0 0
+ I Key Pause   A 2 pause_pass
#+ I Schedule 1000 Key KP_Home A 2 -
#+ I Schedule 1000 Key Pause   A 2 -
Key Pause A 2 pause_numlk_on

DestroyFunc pause_pass
AddToFunc   pause_pass
+ I Echo pause_pass
+ I Key Pause A N -
+ I Key Pause A 2 -
+ I Schedule 50 FakeKeypress press Pause
+ I Schedule 100 Key Pause A N pause_numlk_off
+ I Schedule 100 Key Pause A 2 pause_numlk_on

There is a race somewhere : without the delays, the FakeKeypress
in pause_pass triggers pause_numlk_{on|off}. But the main
problem is that Xterms don't see the KeyPress event.

-- 
André Majorel http://www.teaser.fr/~amajorel/



Re: FVWM: Bind key sequences

2012-04-29 Thread Andre Majorel
On 2012-04-28 13:29 +0100, Thomas Adam wrote:
 On 28 April 2012 13:25, Dan Espen des...@verizon.net wrote:
  Andre Majorel aym-m...@teaser.fr writes:
 
  Is there a way to bind key *sequences* to functions ? EG
  [kp-*][1] to switch to page (0,0), etc.
 
  The best way to bind sequences is to use a menu with hot keys.
 
  kp-* to bring up the menu,
  1 to select a menu entry that has 1 assigned as a short cut.
 
  I actually use kp-* as a menu key and the menu goes by so fast
  you almost don't see it.
 
 Oh, that.
 
 The solution in the FAQ is what I use (heavily modified, of course):
 
 http://fvwm.org/documentation/faq/#3.27

Thanks folks. This makes [Pause][KP_7] switch to page (0, 0)
whether or not num-lock is on :

DestroyFunc pause
AddToFunc   pause
+ I Key KP_Home A N GotoPage 0 0
+ I Schedule 1000 Key KP_Home A N -
Key Pause A N pause

DestroyFunc pause_numlock
AddToFunc   pause_numlock
+ I Key KP_Home A 2 GotoPage 0 0
+ I Schedule 1000 Key KP_Home A 2 -
Key Pause A 2 pause_numlock

Note how KP_Home must be used, even though the actual event is
KP_7. There may be a simpler way but I've had enough for
tonight.

-- 
André Majorel http://www.teaser.fr/~amajorel/



Re: FVWM: Bind key sequences

2012-04-29 Thread Thomas Adam
On Sun, Apr 29, 2012 at 10:35:45PM +0200, Andre Majorel wrote:
 Note how KP_Home must be used, even though the actual event is
 KP_7. There may be a simpler way but I've had enough for
 tonight.

No, there isn't.  It's two different keysyms, depending on whether Numlock
is used.  That's expected.

-- 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: FVWM: Bind key sequences

2012-04-28 Thread Thomas Adam
On 28 April 2012 11:49, Andre Majorel aym-m...@teaser.fr wrote:
 Is there a way to bind key *sequences* to functions ? EG
 [kp-*][1] to switch to page (0,0), etc.

 Thanks in advance.

Define what you mean by sequence in more detail.  You can already
bind KP_* keys.

-- Thomas Adam



Re: FVWM: Bind key sequences

2012-04-28 Thread Thomas Adam
On 28 April 2012 13:25, Dan Espen des...@verizon.net wrote:
 Andre Majorel aym-m...@teaser.fr writes:

 Is there a way to bind key *sequences* to functions ? EG
 [kp-*][1] to switch to page (0,0), etc.

 The best way to bind sequences is to use a menu with hot keys.

 kp-* to bring up the menu,
 1 to select a menu entry that has 1 assigned as a short cut.

 I actually use kp-* as a menu key and the menu goes by so fast
 you almost don't see it.

Oh, that.

The solution in the FAQ is what I use (heavily modified, of course):

http://fvwm.org/documentation/faq/#3.27

-- Thomas Adam