Permalink
Browse files

client: mousePress() button is one based, shift accordingly

 - button shift was off by one so mousePress(button=1) would send a
   button 2 event
  • Loading branch information...
1 parent 0e8ef2d commit 63286b873f85911c3995ab9147ff0cba7088c661 @sibson sibson committed May 19, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 tests/functional/test_send_events.py
  2. +1 −1 vncdotool/client.py
@@ -66,5 +66,5 @@ def test_mouse_move(self):
def test_mouse_button_two(self):
self.run_vncdotool('click 2')
- self.assertMouse(0, 0, 0x4)
+ self.assertMouse(0, 0, 0x2)
self.assertDisconnect()
View
@@ -120,7 +120,7 @@ def mousePress(self, button):
button: int: [1-n]
"""
- buttons = 1 << button
+ buttons = 1 << (button - 1)
self.pointerEvent(self.x, self.y, buttonmask=buttons)
self.pointerEvent(self.x, self.y, buttonmask=0)

0 comments on commit 63286b8

Please sign in to comment.