Changing desk using key bindings and Edge commands

Hi, a friend of mine want a (strange) way to change his pages.
His desktopsize is 5x1 and he wants to switch from one page to another using the edge, but using ‘alt’ key on right/left edge to “authorize” the switch.

I’ve tried this :

[code]Key Meta_L A N ChangeBureau

EdgeScroll 0 0

DestroyFunc ChangeBureau
AddToFunc ChangeBureau

  • I Test (EdgeHasPointer Right) GotoPage +1 0
  • I Test (EdgeHasPointer Left) GotoPage -1 0[/code]

But it doesn’t work, any hints ? Thx

You were close. For a start you cannot use a modifier a single key press and map it to actions, it has to come in conjunction with a non-modifier. This implies a proper key-binding, as in:

Key P A M ChangeBureau

Hence you have to also change your logic slightly, and set EdgeScroll and a really high EdgeResistance, as in:

EdgeResistance 900000 900000
EdgeScroll 1 1

DestroyFunc ChangeBureau
AddToFunc ChangeBureau
+ I Test (EdgeHasPointer Right) GotoPage +1 0
+ I Test (EdgeHasPointer Left) GotoPage -1 0

To be honest though I would just use EdgeCommand for all of it.

– Thomas Adam

Thx for reply, :slight_smile:
I forgot the “p” in the GotoPage action.
So the correct command is :

[code]+ I Test (EdgeHasPointer Right) GotoPage +1p 0

  • I Test (EdgeHasPointer Left) GotoPage -1p 0[/code]
    I’ve tried with Edgecommand but didn’t know the syntax to grab a key (alt 8) ) in a function, I thought this was ‘simplier’.

You can’t grab a modifier as a single key and expect it to perform an action – it has to be in conjunction with another key. Since it’s a rather off requirement, ditching that dependency and doing everything as you have it via EdgeCommand instead is just my suggestion.

– Thomas Adam