Question using AnalogButtons

I'm experimenting with the AnalogButtons library found at:

I can't get anything to compile without the void b1Click() void b2Click() etc. functions for each button I create.

Is there a way to handle all buttons I create in one function, something like:

void HandleButtons()

and then work with the buttons using if/else statements (without modifying library)? If not, that's OK, it just seems a little cumbersome, at least to me (being a beginner!)

I can usually follow how a sketch interacts with a library, but this one is a little confusing, as it also is using what I think are pointer operators.


That's sort of like asking:

I just got a new car. Now how can I use this thing to walk to work? I mean without modifying the car at all. I just think it is cumbersome to have to deal with the keys and steering wheel.

If you don't want to use the callbacks that library uses and just want to handle your buttons in one function with if statements then the simple answer is to get rid of the library and write your function the way you want. At that point there is no point in that library anymore.

Something like this. Change the values tested to actual values you get from your buttons when pressed. I just made these up off the top of my head

int val = analogRead(whateverPinYouUsed);

if(val < 150) {
   // button 1 was pressed, do your thing
else if (val < 300) {
  // button 2 was pressed, do your thing
else if (val < 450) {
  // button 3 was pressed, do your thing
else if (val < 600) {
  // button 4 was pressed, do your thing

//  and so on and so on.

If you want to add debouncing or time the presses then do so in the if blocks as you will.