text: try:
      import simplegui
  except ImportError:
      import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
  
  
  class Keyboard:
      """Object which abstracts keyboard interactions"""
      def __init__(self):
          self.right = False
          self.left = False
          self.up = False
          self.space = False
          self.down = False
          self.b = False
  
      def keyDown(self, key):
          if key == simplegui.KEY_MAP['right']:
              self.right = True
          if key == simplegui.KEY_MAP['left']:
              self.left = True
          if key == simplegui.KEY_MAP['up']:
              self.up = True
          if key == simplegui.KEY_MAP['space']:
              self.space = True
          if key == simplegui.KEY_MAP['down']:
              self.down = True
          if key == simplegui.KEY_MAP['b']:
              self.b = True
  
      def keyUp(self, key):
          if key == simplegui.KEY_MAP['right']:
              self.right = False
          if key == simplegui.KEY_MAP['left']:
              self.left = False
          if key == simplegui.KEY_MAP['up']:
              self.up = False
          if key == simplegui.KEY_MAP['space']:
              self.space = False
          if key == simplegui.KEY_MAP['down']:
              self.down = False
          if key == simplegui.KEY_MAP['b']:
              self.b = False
  