darcs patch: U.EZConfig: Correct additionalKeysP M2-M5 values

Sun Sep 6 01:05:03 MDT 2009 Wirt Wolff

hehe, this foolish interface won't allow birdtrack code it thinks means I'm top posting. So add this.
Since the parser only runs the conversion on chars in "12345" use !! for concise clarity. Considered using 2^(n+2) or shiftL, or crazy ugly overkill like
return $ fromMaybe (modMask c) (mbMod (read [n])) where mbMod i = lookup i $ zip [1..] [mod1Mask,mod2Mask,mod3Mask,mod4Mask,mod5Mask]
... but figured this is appropriate use of the much maligned (!!). More context:
parseModifier :: XConfig l -> ReadP KeyMask parseModifier c = (string "M-" >> return (modMask c)) +++ (string "C-" >> return controlMask) +++ (string "S-" >> return shiftMask) +++ do char 'M' n <- satisfy (`elem` ['1'..'5']) char '-' return $ f n -- f converts
Also added couple of minor style changes unrelated to the Mn issue. regards, -- wmw

Wirt Wolff
Sun Sep 6 01:05:03 MDT 2009 Wirt Wolff
* U.EZConfig: Correct additionalKeysP M2-M5 values Was 8,9,10,11,12 rather than needed 8,16,32,64,128 Attachment (u_ezconfig_-correct-additionalkeysp-m2_m5-values.dpatch):
text/x-darcs-patch, 69 KiB This 2009 Sep 6 version is obsolete. It triggered darcs bug get_extra commuting patches. Regenerated and resent.
participants (1)
-
Wirt Wolff