changed onUp, onDown... to inout(int code) with defines