diff --git a/eris/eris/__main__.py b/eris/eris/__main__.py index c30e4f1..e886ab3 100755 --- a/eris/eris/__main__.py +++ b/eris/eris/__main__.py @@ -615,10 +615,10 @@ class Help: def on_mouse_input(self, term_code): event = terminal.decode_mouse_input(term_code) - if event[1] == terminal.WHEEL_UP_MOUSE: + if event[1] == terminal.MOUSE_WHEEL_UP: self.view.portal.scroll_up() fiil3.APPEARANCE_CHANGED_EVENT.set() - elif event[1] == terminal.WHEEL_DOWN_MOUSE: + elif event[1] == terminal.MOUSE_WHEEL_DOWN: self.view.portal.scroll_down() fill3.APPEARANCE_CHANGED_EVENT.set() @@ -866,10 +866,10 @@ class Screen: self._help_widget.on_mouse_input(term_code) return event = terminal.decode_mouse_input(term_code) - if event[0] not in [terminal.PRESS_MOUSE, terminal.DRAG_MOUSE]: + if event[0] not in [terminal.MOUSE_PRESS, terminal.MOUSE_DRAG]: return x, y = event[2:4] - if event[0] == terminal.DRAG_MOUSE: + if event[0] == terminal.MOUSE_DRAG: last_x, last_y = self._last_mouse_position dx, dy = x - last_x, y - last_y if self._is_summary_focused: @@ -877,9 +877,9 @@ class Screen: else: self._move_listing((-dx, -dy)) else: # Mouse press - if event[1] == terminal.WHEEL_UP_MOUSE: + if event[1] == terminal.MOUSE_WHEEL_UP: self.listing_page_up() - elif event[1] == terminal.WHEEL_DOWN_MOUSE: + elif event[1] == terminal.MOUSE_WHEEL_DOWN: self.listing_page_down() else: view_width, view_height = self._summary._view_widget.portal.last_dimensions diff --git a/fill3/fill3/terminal.py b/fill3/fill3/terminal.py index aba8764..f2c52e5 100644 --- a/fill3/fill3/terminal.py +++ b/fill3/fill3/terminal.py @@ -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