code: def touch2screen(w, h, o, x, y):
      '''convert touch position'''
      if o == 0:
          return x, y
      elif o == 1: # landscape-right
          return y, w-x
      elif o == 2: # upsidedown
          return w-x, h-y
      elif o == 3: # landscape-left
          return h-y, x
      return x, f touch2screen(w, h, o, x, y):
      '''convert touch position'''
      if o == 0:
          return x, y
      elif o == 1: # landscape-right
          return y, w-x
      elif o == 2: # upsidedown
          return w-x, h-y
      elif o == 3: # landscape-left
          return h-y, x
      return x, y
docs: convert touch position