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/

Reply via email to