Modulo Wi-Fi ESP8266

Si, si fa proprio in quel modo.
Uno sketch scritto per uno shield che ha dei tasti configurati a quel modo, quello con LCD e alcuni tasti di DFrobot

https://www.dfrobot.com/wiki/index.php/Arduino_LCD_KeyPad_Shield_(SKU:_DFR0009)

La parte che fa il lavoro è questa

 adc_key_in = analogRead(0);      // read the value from the sensor 
 // my buttons when read are centered at these valies: 0, 144, 329, 504, 741
 // we add approx 50 to those values and check to see if we are close
 if (adc_key_in > 1000) return btnNONE; // We make this the 1st option for speed reasons since it will be the most likely result
 // For V1.1 us this threshold
 if (adc_key_in < 50)   return btnRIGHT;  
 if (adc_key_in < 250)  return btnUP; 
 if (adc_key_in < 450)  return btnDOWN; 
 if (adc_key_in < 650)  return btnLEFT; 
 if (adc_key_in < 850)  return btnSELECT;

I valori andranno adattati alle tue esigenze in funzione del valore delle resistenze usato.