if (max == 0) return;
static void handle_key(int shift, int& value, int max, int amt = 1){	if(shift)		value -= amt;	else		value += amt;			while (value<0)		value = max+value;	while (value>=max)		value = value-max;}