Subject: FVWM: Desk Warping ?

From: Debjyoti Paul <[email-masked]>
Date: Tue, 18 Feb 1997 15:52:01 +0530

Hi

I have a small problem:

I have some keyboard shortcuts for shifting desks (increment and
decrement). However, as the number of desks are not limited, i
can increment(or decrement) infinitely. I want the # of desks to be
limited (4 is enough for me) and to have warping. i.e. if i try
incrementing the desk when I am at desk 3, it would go to desk 0
and likewise from 0 to 3 when decrementing. 

How do I do it ? I am using 1.24r.

The key mapping for incrementing & decrementing :

Key Next        A       M       Desk -1 0 
Key F29         A       M       Desk -1 0
Key Prior       A       M       Desk 1 0 
Key F35         A       M       Desk 1 0 

maps the page-up, page-down keys of a sun keyboard (total 4) when
the meta key is pressed (the diamond key).

thanks a lot
Debjyoti
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Tim Phipps <[email-masked]>
Date: Tue, 18 Feb 1997 11:02:59 GMT

> How do I do it ? I am using 1.24r.
I am not certain but I am pretty confidant that 1.24r can redefine functions.  
Certainly 2.0.4x can.  One way to achieve what you want is to have two functions 
for going forwards and backwards around your desks that get redefined when you 
switch desks.  You need four desk warping functions thus:

AddToFunc GotoDesk1 "I" Desk 0 1
+                   "I" DestroyFunc NextDesk
+                   "I" DestroyFunc PrevDesk
+                   "I" AddToFunc NextDesk "I" GotoDesk2
+                   "I" AddToFunc PrevDesk "I" GotoDesk4

AddToFunc GotoDesk2 "I" Desk 0 2
+                   "I" DestroyFunc NextDesk
+                   "I" DestroyFunc PrevDesk
+                   "I" AddToFunc NextDesk "I" GotoDesk3
+                   "I" AddToFunc PrevDesk "I" GotoDesk1

AddToFunc GotoDesk3 "I" Desk 0 3
+                   "I" DestroyFunc NextDesk
+                   "I" DestroyFunc PrevDesk
+                   "I" AddToFunc NextDesk "I" GotoDesk4
+                   "I" AddToFunc PrevDesk "I" GotoDesk2

AddToFunc GotoDesk4 "I" Desk 0 4
+                   "I" DestroyFunc NextDesk
+                   "I" DestroyFunc PrevDesk
+                   "I" AddToFunc NextDesk "I" GotoDesk1
+                   "I" AddToFunc PrevDesk "I" GotoDesk3

Plus then in the startup functions You will need
+                   "I" AddToFunc NextDesk "I" GotoDesk2
+                   "I" AddToFunc PrevDesk "I" GotoDesk4

And then bind your next/prev keys to the dynamic functions
Key Next        A       M       NextDesK
Key F29         A       M       NextDesk
Key Prior       A       M       PrevDesk 
Key F35         A       M       PrevDesk 

This is off the top of my head and is not tested and probably doesn't work.
It relies on DestroyFunc which may not be in 1.24r.

Hope it helps anyway,
Timbo.