title: Keyboard input over SSH to the raspberry pi3 with pynput function in python
body: <p>I'm trying to control a small car toy using the raspberry pi 3 the SSH 
  from my laptop. </p>
  
  <p>The challenge I'm facing is, when I'm directly connected on RPi (mouse, 
  keyboard and monitor plugged to the RPI) everything works well, but 
  when I connect to RPi over the SSH connection, this is what I see as an 
  output: Xlib.error.DisplayNameError: Bad display name ""</p>
  
  <p>The method I'm using to connect to my RPi is "ssh pi@"</p>
  
  <p>Please can you advice me what to do next?</p>
  
  <p>The sample code I'm using is shown below:</p>
  
  <p>Thank you,
  Johny 1984</p>
  
  <pre><code>    from pynput import keyboard
      from pynput.keyboard import Key, Listener
  
      def on_press(key):
          # DO SOMETHING
  
      def on_release(key):
          # DO SOMETHING
  
      with keyboard.Listener(on_press=on_press, on_release=on_release) as listener:
          listener.join()
  </code></pre>
  
  <p>the way I connecting to RPI over SSH</p>
  
  <pre><code>ssh pi@(RPI_IP_ADDRESS)
  </code></pre>
  
  <p>The error with the bunch of text above:</p>
  
  <pre><code>Xlib.error.DisplayNameError: Bad display name ""
  </code></pre>