Skip to content

Commit c24388c

Browse files
authored
Merge pull request #177 from Linearity/master
Fixed off-by-one error in mouse button bit-masking
2 parents 4bde0c1 + eb7accd commit c24388c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SDL/Input/Mouse.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ getMouseButtons :: MonadIO m => m (MouseButton -> Bool)
203203
getMouseButtons = liftIO $
204204
convert <$> Raw.getMouseState nullPtr nullPtr
205205
where
206-
convert w b = w `testBit` fromIntegral (toNumber b)
206+
convert w b = w `testBit` fromIntegral (toNumber b - 1)
207207

208208
newtype Cursor = Cursor { unwrapCursor :: Raw.Cursor }
209209
deriving (Eq, Typeable)

0 commit comments

Comments
 (0)