In the schematic posted in #1, R4 have different values ... for different commands.
The code above is for reading accurate ADC ; works very, very fine.
Tried to read short/long press of button ... but no succes. No matter what I do, I always have same result, as pressed "short".
Sorry for my poor english, I use g...translate for many words.