Coding style.
- Rename mouse actions.
This commit is contained in:
parent
abc5b15d90
commit
7ce8c0b9dc
2 changed files with 18 additions and 18 deletions
|
|
@ -81,12 +81,12 @@ def interactive():
|
|||
|
||||
|
||||
MOUSE = ESC + "[M"
|
||||
RELEASE_MOUSE = 0
|
||||
DRAG_MOUSE = 1
|
||||
CLICK_MOUSE = 2
|
||||
PRESS_MOUSE = 3
|
||||
WHEEL_UP_MOUSE = 4
|
||||
WHEEL_DOWN_MOUSE = 5
|
||||
MOUSE_RELEASE = 0
|
||||
MOUSE_DRAG = 1
|
||||
MOUSE_CLICK = 2
|
||||
MOUSE_PRESS = 3
|
||||
MOUSE_WHEEL_UP = 4
|
||||
MOUSE_WHEEL_DOWN = 5
|
||||
|
||||
|
||||
def decode_mouse_input(term_code):
|
||||
|
|
@ -95,14 +95,14 @@ def decode_mouse_input(term_code):
|
|||
x, y = (keys[1] - 33) % 256, (keys[2] - 33) % 256
|
||||
button = ((b & 64) / 64 * 3) + (b & 3) + 1
|
||||
if b & 3 == 3:
|
||||
action = RELEASE_MOUSE
|
||||
action = MOUSE_RELEASE
|
||||
button = 0
|
||||
elif b & 2048:
|
||||
action = RELEASE_MOUSE
|
||||
action = MOUSE_RELEASE
|
||||
elif b & 32:
|
||||
action = DRAG_MOUSE
|
||||
action = MOUSE_DRAG
|
||||
elif b & 1536:
|
||||
action = CLICK_MOUSE
|
||||
action = MOUSE_CLICK
|
||||
else:
|
||||
action = PRESS_MOUSE
|
||||
return (action, button, x, y)
|
||||
action = MOUSE_PRESS
|
||||
return action, button, x, y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue