@@ -67,7 +67,7 @@ ctrlBit = 16
6767
6868-- These bits indicate the buttons involved:
6969buttonMask :: Int
70−buttonMask = 3
70+buttonMask = 67
7171
7272leftButton :: Int
7373leftButton = 0
@@ -78,6 +78,12 @@ middleButton = 1
7878rightButton :: Int
7979rightButton = 2
8080
81+scrollUp :: Int
82+scrollUp = 64
83+
84+scrollDown :: Int
85+scrollDown = 65
86+
8187hasBitSet :: Int -> Int -> Bool
8288hasBitSet val bit = val .&. bit > 0
8389
@@ -100,6 +106,8 @@ getSGRButton mods =
100106 let buttonMap = [ (leftButton, BLeft)
101107 , (middleButton, BMiddle)
102108 , (rightButton, BRight)
109+ , (scrollUp, BScrollUp)
110+ , (scrollDown, BScrollDown)
103111 ]
104112 in case lookup (mods .&. buttonMask) buttonMap of
105113 Nothing -> failParse