title: Using Callbacks in Python Mouse Module (retrieving event types)
body: <p>I am using Python Module "Mouse" to capture mouse inputs (more specifically, mouse coordinates, input button, and type of input).
  Source: <a href="https://github.com/boppreh/mouse" rel="nofollow noreferrer">https://github.com/boppreh/mouse</a></p>
  
  <p>Looking at the source code for on_button() and on_click(), I am not sure how to pass the event_type back for "mouse button down" and "mouse button up" back to my code:</p>
  
  <pre><code>def left_mouse():
      print('LEFT ', mouse.get_position())
      # I want to get the [mouse button, example: left] and [type, example: up] from the logging
  
  mouse.on_click(left_mouse)
  </code></pre>
  
  <p>Source code from MOUSE MODULE: on_button and on_click; I'm guessing I'm not calling callback appropriately but can't figure out what's the right approach:</p>
  
  <pre><code>def on_button(callback, args=(), buttons=(LEFT, MIDDLE, RIGHT, X, X2), types=(UP, DOWN, DOUBLE)):
      """ Invokes `callback` with `args` when the specified event happens. """
      if not isinstance(buttons, (tuple, list)):
          buttons = (buttons,)
      if not isinstance(types, (tuple, list)):
          types = (types,)
  
      def handler(event):
          if isinstance(event, ButtonEvent):
              if event.event_type in types and event.button in buttons:
                  callback(*args)
      _listener.add_handler(handler)
      return handler
  
  def on_click(callback, args=()):
      """ Invokes `callback` with `args` when the left button is clicked. """
      return on_button(callback, args, [LEFT], [UP])
  </code></pre>
  
  <p>Thanks as always.</p>