ESP 32 Touch pin issue

No. A boolean variable can only have one of 2 states, either true or false. Greater than really has no meaning in the context of a boolean value

What

    if (touchValue < lowerThreshold && currentlyTouched == false)

says in English is
"if the touch value is less than the lower threshold and the currently touched boolean variable is false then execute the code in the following code block"

ie, it tests whether the touch value has fallen below the lower threshold and it has not happened before, then execute the following code

O O I see
This is the actual part what I missed to gain

Fine
So is this kind of design are applicable for analog inputs ??

Right now I am working on it
Should I try for that or need some extra

You are already working with an analogue input

Ya it is dealing with that one

So if I connect different value resistors between touch plate and cable connected to pic
would it work for different values on same input line ??

(Suppose I want to connect multiple inputs through a single line only)

What exactly is it that you want to do ?

Actually with less number of pins on WROOM model 38-pin

I am trying to increase number of inputs as much as possible using touch or analog INs, whatever

I just designed this one with 2 analog inputs with

resistor 680k which shows range of 2000 to 2300 and
resistor 470k which shows range of 2400 to 2600 approx

const int AnalogPin = 15;
const int ledPin = 2;
const int ledPin1 = 23;

// variable for storing the Analog value
int AnalogValue = 0;

const int lowerThreshold = 2000;  

const int upperThreshold1 = 2000;
const int upperThreshold2 = 2300;

const int upperThreshold3 = 2400;
const int upperThreshold4 = 2600;

boolean currentlyTouched = false;

void setup() {
  Serial.begin(9600);
  pinMode (ledPin, OUTPUT);
  pinMode (ledPin1, OUTPUT);

}

void loop() {
  // Reading Analog value
  AnalogValue = analogRead(AnalogPin);

  if (AnalogValue < lowerThreshold && currentlyTouched == false)
    {
        Serial.println("OFF");
        digitalWrite(ledPin, LOW);
        currentlyTouched = true;
    }
  else if (AnalogValue > upperThreshold1 && AnalogValue < upperThreshold2 && currentlyTouched == true)
    {
        Serial.println("ON-led1");
        digitalWrite(ledPin, HIGH);
        currentlyTouched = false;
    }
  else if (AnalogValue > upperThreshold3 && AnalogValue < upperThreshold4 && currentlyTouched == true)
    {
        Serial.println("ON-led2");
        digitalWrite(ledPin1, HIGH);
        currentlyTouched = false;
    }

}

On serial monitor it displays the message for both inputs separately while pressing each button 

Please check !!!!!!!!!  

I do not understand how you have things wired. Please post a schematic showing what you have done

Very first LED is built in

So I didn't connect any external LED at pin 2 !!

That is a standard way to connect multiple switches to an analogue input. You will find dozens of examples of it on the forum

Hmm Ya I gone through some with guidance from all you expertise here

As there are some kind of restrictions with analog type things on MCUs
So I am trying to sort out all those with number of ways

Well this newly generated code from your given basic code is working well for now
(Just a bit breadboard issues so values are varying time to time and need to fix)

So shall I now try to connect the touch read with different resistor values ?
Will it work on the same line or I need to go for other pins ?

Please guide and till the time I am planning for few more things to add !!

You can use the resistor ladder circuit on any GPIO pin of the ESP32. You do not need to use the special touch sensor pins

Ya but that will need to connect push buttons with ladder pattern

What if I am planning for touch plates ??

OR

Should I connect touch switch RRP223 externally with a transistor as switch
in place of push buttons ???

Your diagram shows pushbuttons and using them, or something that works like a switch, would make things easier

So what about these kind of designs above ???????

Does the TTP223 sensor use 5V or 12V ?

No no maximum limit is 5v only
Not more than that !!!

So is this TTP223 module is final one Sir ??

Shall I proceed with this model only and not with the built-in touch read of ESP32 ????

From memory, there are only 6 pins on the ESP32 that allow you to use the touchRead() function. If you want more touch input pads then you will need to use a different method such as analogRead() and a resistor ladder.

Be aware, however, that will quite probably not be reliable unless you use an external device, maybe the TTP223, on each pin. The ESP32 touch pins do not need any extra circuitry because they work differently

Yeah with Wroom model 38 pin it has 10 touch pins as per diagram below

And I observed it practically one by one on trainer board

Though it is 10 but of no use as this one is engaging approx all the pins for further use like sensors or display devices and etc etc things !!!

Too I need 16 or 20 or may be more than 20 inputs here so a ladder pattern is all the way good !!!

Yes yes sure !
In case of resistor ladder, I will have to connect a touch sensor with a transistor switch and a reference resistor for a fixed value say 2000 or 2250 like that.

For more number of inputs in a single line the reference resistor value should be allotted wisely to get a bit big difference between 2 values as the range falls between 0 to 4096 something.

Suppose if it is not possible to adjust more that 10 inputs on single line then I need to switch for another input pin

Like pin 36 for 10 inputs
and pin 39 for 10 inputs
and so on . . . . . .

Is it a good going plan Sir ??

Differentiating between 10 different analogue inputs on a single pin may be difficult but you won't know until you try it

Have you considered using a touch sensitive screen for user input ?