KeypadController.
More...
|
using | KeystrokeCallback = std::function< bool(const String &, String &)> |
| Callback definition for onKeystroke function. More...
|
|
template<typename T>
class KeypadController< T >
KeypadController.
◆ KeystrokeCallback
Callback definition for onKeystroke function.
Gets called when device receive a setBands
request
- Parameters
-
[in] | deviceId | String which contains the ID of device |
[in] | keystroke | String keystroke
INFO , MORE , SELECT , UP , DOWN , LEFT , RIGHT , PAGE_UP , PAGE_DOWN , PAGE_LEFT , PAGE_RIGHT |
[out] | keystroke | String keystroke
INFO , MORE , SELECT , UP , DOWN , LEFT , RIGHT , PAGE_UP , PAGE_DOWN , PAGE_LEFT , PAGE_RIGHT |
- Returns
- the success of the request
- Return values
-
true | request handled properly |
false | request was not handled properly because of some error |
Example-Code
bool onKeystroke(
const String& deviceId, String &keystroke) {
Serial.printf("Device %s, key %s pressed\r\n", deviceId.c_str(), keystroke.c_str());
return true;
}
void onKeystroke(KeystrokeCallback cb)
Set callback function for SendKeystroke request.
Definition: KeypadController.h:47
◆ onKeystroke()
Set callback function for SendKeystroke
request.
- Parameters
-
cb | Function pointer to a KeystrokeCallback function |
- Returns
- void
- See also
- KeystrokeCallback