Issue 608 in xmonad: EZConfig `exchangeKeys` function

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue 608 in xmonad: EZConfig `exchangeKeys` function

codesite-noreply@google.com
Status: New
Owner: ----

New issue 608 by [hidden email]: EZConfig `exchangeKeys` function
https://code.google.com/p/xmonad/issues/detail?id=608

There should be an exchangeKeys function to swap two keys without needing  
to copy their implementation.

Here is my try of an implementation, but I couldn’t get it working, it  
compiles but nothing happens. Probably a simple logical error.

exchangeKeys :: XConfig a -> ((KeyMask, KeySym), (KeyMask, KeySym)) ->  
XConfig a
exchangeKeys conf (map, map') =
   conf { keys = \cnf ->
             let
               -- fwd = M.findWithDefault $ pure ()
               fwd map keys = keys M.! map
               oldKeys = keys conf cnf
               (com, com') = (fwd map oldKeys, fwd map' oldKeys)
             in
              M.insert map com' $ M.insert map' com oldKeys
        }

There should be `exchangeKeysP`, too.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Reply | Threaded
Open this post in threaded view
|

Re: Issue 608 in xmonad: EZConfig `exchangeKeys` function

codesite-noreply@google.com

Comment #1 on issue 608 by [hidden email]: EZConfig `exchangeKeys`  
function
https://code.google.com/p/xmonad/issues/detail?id=608

Hi, thanks!  I will take a look at this if no one else gets around to it in  
the meantime, but I may not get to it for a few weeks since I will be  
moving across the country and travelling.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
Reply | Threaded
Open this post in threaded view
|

Re: Issue 608 in xmonad: EZConfig `exchangeKeys` function

codesite-noreply@google.com

Comment #2 on issue 608 by [hidden email]: EZConfig `exchangeKeys`  
function
https://code.google.com/p/xmonad/issues/detail?id=608

Oh, and the commented-out fwd is the right one. I tried to make it crash  
with (!), but that didn’t work somehow.

--
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
_______________________________________________
xmonad mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad