title: Confusing regarding function interpretation
body: <p>I'm trying to interface a 4x4 keypad with a TFT display. I want to implement a keypad event listener such that the appropriate screen will be loaded each time a key is pressed. The event listener will be keeping track of which screen is currently loaded, and will be listening for specific key inputs.</p>
  
  <p>The keypad event listener is defined (and will be called in the setup() function in my main arduino sketch (I'm using Atmel Studio + Visual muicro arduino plug-in. The code is written in C++):</p>
  
  <pre><code>void Keypad_apiClass::createKeypadEventHandler(void)
  {
      keypad44.addEventListener(screenState_keyHandler);
  }
  </code></pre>
  
  <p>And the <code>screenState_keyHandler</code> is defined thus:</p>
  
  <pre><code>void screenState_keyHandler(KeypadEvent keyPressed)
  {
     switch(Display_api.screenDisplayID)
     {
        case 0x0A:      //menu screen
        switch(keyPressed)
        {
       case '1':
       //go to sensor readings screen
       break;
  
       case '2':
       //go to  system settings screen
       break;
  
       case '#':
       //go to  systemReboot screen
       break;
  
       default:
       //do nothing
       break;
    }
    break;
  
    default:
    break;
    }
  }
  </code></pre>
  
  <p>When I look at the prototype of the function <code>addEventListener</code> (in the header file where it is declared, I see this: </p>
  
  <pre><code>void addEventListener(void (*listener)(char));
  </code></pre>
  
  <p>I'm having trouble understanding the parameter of the prototype. Is it expecting a function pointer or what? Could someone please explain the parameter in the prototype above?</p>
  
  <p>When I compile, I get</p>
  
  <pre><code>    Compiling 'adutoSecuritySystem' for 'Arduino Mega w/ ATmega2560 (Mega 2560)'
  keypad_api.cpp:In member function 'void Keypad_apiClass::createKeypadEventHandler()'
  keypad_api.cpp:112:50: error: no matching function for call to 'Keypad::addEventListener(&lt;unresolved overloaded function type&gt;)'
  keypad_api.cpp:candidate is
  Keypad.h:addEventListener(void (*)(char))
  Keypad.h:no known conversion for argument 1 from '&lt;unresolved overloaded function type&gt;' to 'void (*)(char)'
  Error compiling
  </code></pre>
  
  <p>That's why I'm confused! The only other place the function exists is in the member declaration of the class:</p>
  
  <pre><code>class Keypad_apiClass
  {
   protected:
  
  
   public:
     void init();
     char retrieveKeyPressed(void);
     char waitAndRetrieveKeyPressed(void);
     uint8_t returnKeyPressed_IntVersion(char keyPressed);
     void createKeypadventHandler(void);
     void screenState_keyHandler(KeypadEvent keyPressed);
  };
  </code></pre>