check if button is pressed

hi to all.
i have a problem with GUI.Button.

i created a button like this:

GUI.Button(new Rect(0,0,40,40),“up”);

for check if button is pressed i do :

if(GUI.Button(new Rect(0,0,40,40),“up”))
//button press
else
//button non press

my problem is that if i press button for first time code execute is //button press
but if i keep hold button code execute is //button non press.

somebody can teel me how i can understand if button is pressed?

i need this for move my character but i cant use Input.GetAxis because my game run on android.
thanks.

You should use GUI.RepeatButton:

  if(GUI.RepeatButton(new Rect(0,0,40,40),"up")){
    ...

RepeatButton returns true while the button is pressed.