Mouse Click to keyCode

ok, in first step sorry for my bad en:D

So, i trying to make a 2d game, for android and i make a car, wich i need to move left and writh …so

i made, with this code:

var leftKey : KeyCode;
var rightKey : KeyCode;

var speed : float = 15;

function Update ()
{
	if (Input.GetKey(rightKey))
	{
		rigidbody2D.velocity.x = speed;
	}
	else if (Input.GetKey(leftKey))
	{
		rigidbody2D.velocity.x = speed *-1;
	}
	else
	{
		rigidbody2D.velocity.x = 0;
	}
}

but i can`t move this car left and right with A and D or any buttons …

BUT…

i need to move this car with my touch screen
so, what i made it for that…i create to objects, for 1/2 of screen (left and right bottons)…

my menu work good with this code

function OnMouseUp()

and i try and i try but i don`t know how to connect this function…becouse are two differit commponet of two differit objects…so i stuck HERE…

it`s exist any ideea to put that fucion “OnMouseUp” to simulate a “A” or another keycode…to move my car?

Thank You:)

SORRY FOR THIS VERY BAD EN!!!

Maybe you can use

Input.GetTouch(0).position;

and then check for whether X is on the left/right side of the screen ?

void Update() 
{
  if (Input.touchCount > 0)
  {
          if (Input.GetTouch(0).position.x < halfX)
          {
            // Move left.
          } else if (Input.GetTouch(0).position.x > halfX)
          {
            // Move right
          }  else 
          {
            // reset movement.
          }
  } else 
  {
    // reset movement.
  }
}