Causing one event only

so what code should i have for "looking too see if the pin goes high"

int currState;
int prevState = LOW;
int somePin = someNumber;

void setup() {}

void loop()
{
   currState = digitalRead(somePin);
   if(currState != prevState)
   {
      // A transition occurred - from pressed to released or from released to pressed
      // The value of the current state defines which transition occurred.
   }
   prevState = currState;
}